Michael Faraday was born in a humble family and once he grew old enough, he worked as an apprentice in a bookshop. He read countless of books that made him interested in science, especially electricity. He then attended the lectures of Humphry Davy.
In 1812, Faraday sent a 300 page collection of his notes on Davy's lectures. Impressed, Davy hired Faraday as his lab assistant and met other scientists. That is how Faraday learnt about magnetism and its relation to electricity.
In 1820, Oersted performed an experiment that showed that there is indeed a connection between electricity and magnetism. A nearby compass was moved by a current passing through a wire.
Faraday then began his own experiment which showed that there was relative motion between the coil and magnet resulting in the generation of current in the coil. This result is now known as Faraday's law of induction which became the foundation of the technology used today.