I tried to elaborate a bit...hope it is understandable!
In an electric generator you have, basically a loop of metal wire that can turn inside a magnetic field (for example, inside an horseshoe magnet). This is quite good because the free electrons inside the metal of the loop "feel" the magnetic force (in the field) and either tend to approximate one pole or to escape from the other.
The trick here is to rotate the loop so that, basically, you make them (the free electrons) continuously move inside the wire producing a current!!!
It is like to have a marble on a plank that you hold and continuously oscillate...the marble will move from one side to the other and vice versa:
In the motor you have the same arrangement but now you use your loop to create another "magnet", an electromagnet by passing current into it! The idea here is that now you have 2 magnets one inside the other and the inside one will tend to align to the polarity of the horseshoe magnet. In doing so it will turn the entire loop and so move it on its axis.
This one only movement is not very interesting but if we continuously change the current (direction) inside the loop the electromagnet will continuously change polarity and so move to adapt to the horseshoe magnet...and spin!
Electric Generator --> Mechanical Energy to Electrical Energy
Electric Motor --> Electrical Energy to Mechanical Energy
Electric Generator produces Electrical Energy through use of engine (from a mechanical energy)
Electric Motor produces Mechanical Energy from Electrical Energy, from electric current (can be a DC/AC Power Source)