Basically generators convert mechanical energy into electrical energy while motors convert electrical energy into mechanical energy as it rotates.
(motors; convert; electrical energy; into mechanical energy) (it; rotates; )
motors it
convert rotates
electrical energy into mechanical energy