The interaction of electrical and magnetic effect is known as electromagnetism.
Electromagnetism is one of the most important concepts in physical science. An electromagnet consists of a piece of soft iron with electrical wire wrapped around it.
When an electric current flows through the wire, it produces a magnetic field around the wire and the iron is magnetized.
The greater the current, the stronger the magnetic field. By coiling up the wire many times, the magnetic field produced can be made even stronger.