In 1820 Oersted did this experiment:
and discovered that an electric current creates a magnetic field
Similarly, a coil of wire with a current passing through it generates a magnetic field. This is known as an electromagnet or solenoid .
So now we know that a current can create a magnetic field. If a magnetic field can create a current then we have a means of generating electricity. Experiments showed that a magnetic just sitting next to a wire produced no current flow through that wire. However, if the magnet is moving a current is induced in the wire. The faster the magnet moves, the greater the induced current.
This is the principal behind simple electric generators in which a wire loop is rotated between to stationary magnetics. This produces a continuously varying voltage which in turn produces an alternating current .
Visualization of a simple electric generator:
To generate electricty then, all we really want to do is have some (mechanical) mechanism turn a crank that rotates a loop of wire between stationary magnets. The faster we can get this crank turned, the more current we can generate.
Popular Methods of Turning the Crank: