Faraday discovered that changing magnetic fields can induce electric currents in conductors. This phenomenon, known as electromagnetic induction, underlies the operation of generators and transformers. A generator converts mechanical energy into electrical energy by rotating a coil within a stationary magnetic field, producing alternating current. A transformer works by inducing a changing magnetic field in one coil, which induces an alternating current in a nearby second coil. The relative number of turns in the primary and secondary coils determines whether the transformer steps up or steps down the voltage.