DanD:
Assuming that you don't know about phase angles and hall sensors,
a more rudimentary description is that, for efficiency, you want the
electric motor coil to change direction from
pulling to pushing just a hair before the magnet reaches it.
(Much like a gas engine fires the spark plug so many degrees
before the piston reaches 'top dead center')
There is a sensor that detects when the magnet passes it,
and you can use that information to decide how long
before the magnet arrives to turn on your magnet.
The phase angle on my motor was preset perfectly before it
arrived, I don't know it they were paired at the factory or if
I just got lucky.