The subjects of electricity and magnetism have held a fascination throughout history. As our understanding of these two subjects became clearer, it became more and more obvious that these two seemingly unrelated subjects were closely related. Magnets and electricity have many similarities, and the two entities are deeply intertwined at the physical level.
Opposites Attract; Likes Repel
In electricity, there are two types of charges: positive and negative. When two opposite charges are brought close together (for example, a positive and a negative charge), they will attract each other, and a force will bring the two charges together, whereas two similar charges (for example, two negative charges) will repel each other with an identical force as two opposite charges attract but in the opposite direction. In magnetism, the same principles apply; however, a single magnet contains two "poles": a north pole (which aligns with the north pole of the Earth) and a south pole. In magnets, much as in electricity, like poles repel each other while opposite poles attract each other.
Inverse Square Law
A field is a physical entity that allows one object to influence another object over a distance. For example, a positive electric charge can influence a negative electric charge by attracting it over a distance without the two objects actually coming into contact. In the case of both magnetism and electricity, this influence is subject to the inverse square law; that is, the field strength is inversely proportional to the square of the distance between two objects. For example, if the distance between two magnetic poles is 3, then the field strength between the two will decrease by a factor of 9.
Potential energy is stored within an object and can be made available for other types of energy. Potential energy is usually related to an object's position within a force field; therefore both electric and magnetic objects are subject to potential energy. There are two important types of energy. Electrostatic potential energy is created by a stationary electric charge. This type of energy leads to the concept of voltage, which is used in many everyday applications. The second type of potential energy is electrodynamic, which is created by moving electric charges and acts on magnets. This suggests a deeper relation between electricity and magnetism.
Electricity and Magnetism Influence and Create Each Other
As you can see, magnetism and electricity have many commonalities. However, in 1864, physicist James Clerk Maxwell discovered that these two subjects are even more closely linked. What he found was that electricity and magnetism are two manifestations of the same fundamental property called electromagnetism. To summarize Maxwell's equations, as they became known, stationary electric charges are the source of both electric fields while moving charges (i.e., electric currents) are responsible for magnetic fields. Furthermore, he found that changing electric fields can produce changing magnetic fields and vice versa.