Motion sensor config question... From HA docs

This HA doc has a set of code and I am trying to figure out the purpose of a couple of lines…

Xiaomi Binary

Code:

- alias: If there is motion and its dark turn on the gateway light
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
    from: 'off'
    to: 'on'
  condition:
    condition: numeric_state
    entity_id: sensor.illumination_34ce00xxxx11
    below: 300
  action:
    - service: light.turn_on
      entity_id: light.gateway_light_34ce00xxxx11
      data:
        brightness: 5
    - service: automation.turn_on
      data:
        entity_id: automation.MOTION_OFF
- alias: If there no motion for 5 minutes turn off the gateway light
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
    from: 'on'
    to: 'off'
    for:
      minutes: 5
  action:
    - service: light.turn_off
      entity_id: light.gateway_light_34ce00xxxx11
    - service: automation.turn_off
      data:
        entity_id: automation.Motion_off

So, what is the purpose of the 3 lines at the end of each automation?

 - service: automation.turn_on
      data:
        entity_id: automation.MOTION_OFF

And:

    - service: automation.turn_off
      data:
        entity_id: automation.Motion_off

Alos should those not be all lower case?