The basic principle of a generator was discovered in 1831 by the English scientist Michael Faraday. Faraday discovered a phenomenon known as electromagnetic induction. When a conductor is influenced by a magnetic field, then when the magnetic field changes, this change induces an electromotive force, which is another name for an electric potential (measured in Volts). This potential causes electrons in the conductor to move, which is an electric current. All generators of electric currents- from dynamos that power flashlights in bicycles to the huge generators that produce the electricity to our cities, are based on this principle.
Thus, the basic configuration of a generator is that of a strong magnet, that is surrounded by an electric wire. In order to produce electricity in the wire, all that is needed to do is to force the magnet to move. Practically, the magnet is forced to rotate. This can done by various means: e.g., by burning fuel (in a somewhat analogue way to the way car engines force the car wheels to move), or - in a much more environmental friendly way, by using wind power to rotate the magnet. Such devices are known as windmills.