For a long time electricity and magnetism were thought to be separate forces. In the 19th century Maxwell demonstrated that they were interrelated phenomena then Einstein proved with the Special Theory of Relativity that they are aspects of one unified phenomenon.
The core of the relationship is that a changing magnetic field produces an electric field and conversely, a changing electric field produces a magnetic field.