Till Oersted’s Discovery (1819) electricity and magnetism were thought to be two independent phenomena. This idea was proved to be wrong after Oersted Discovery which is as follows:
If a magnetic needle is placed near a conductor and if a current is passed through the conductor, the needle gets deflected. The direction of deflection of the needle depends upon the direction of the current through the conductor and also on the relative position of the needle with respect to the conductor. If no current passes through the conductor there is no deflection of the magnetic needle.
Conclusion of Oersted Discovery:
The above-mentioned observation leads to the conclusion that a current-carrying conductor develops a magnetic field around it. As current is nothing but the rate of flow of charge, the more fundamental conclusion is that a moving charge, besides developing an electric field, develops a magnetic field also.
Thus, from oersted discovery, we came to know that we can have magnetism from electricity. Naturally, scientists started thinking about whether the reverse effect is possible or not, whether we can have electricity from magnetism or not. Later it was shown by Faraday (1831) that the reverse effect is also possible. After that, it was Maxwell who coupled electricity and magnetism together to put forward a new theory. Popularly known as an electromagnetic theory which shows that one is the source of the other i.e, varying electric field is the source of the magnetic field and vice-versa.