The rotor is covered with copper wire. The stator has a powerful magnet in it.
Electricity is created when the rotor inside a generator rotates.
The magnetic field created when the rotor moves around inside the stator makes an electrical charge inside the copper wire. This charge is collected and sent out as electricity. The way a generator works is that some form of energy must be used to create the motion which turns the rotor. In a portable generator such as you might use in an area with no electricity, a gasoline-powered motor is used to turn the rotor. With Thermo-electricity, steam power is used to turn a steam turbine.