How does a generator work?
An electric generator is a device that converts mechanical energy obtained from an external source into electrical energy as the output.
It is important to understand that a generator does not actually ‘create’ electrical energy. Instead, it uses the mechanical energy supplied to it to force the movement of electric charges present in the wire of its windings through an external electric circuit. This flow of electric charges constitutes the output electric current supplied by the generator. This mechanism can be understood by considering the generator to be analogous to a water pump, which causes the flow of water but does not actually ‘create’ the water flowing through it.
The modern-day generator works on the principle of electromagnetic induction discovered by Michael Faraday in 1831-32. Faraday discovered that the above flow of electric charges could be induced by moving an electrical conductor, such as a wire that contains electric charges, in a magnetic field. This movement creates a voltage difference between the two ends of the wire or electrical conductor, which in turn causes the electric charges to flow, thus generating electric current.
http://www.dieselserviceandsupply.com/How_Generators_Work.aspx