Moving charge produces a magnetic field and a moving magnetic field produces current.
First of all, if you have charge moving through a wire, then there’ll be a magnetic field that develops around the wire. You’ve probably seen experiments with iron shavings and how they form lines on a piece of paper when a magnet is placed under the paper. The lines go from one end of the magnet to the other in 3 dimensions. Even though the paper only shows 2 dimensions, the magnetic lines still go all around the magnet from one end to the other. The iron pieces line up with the magnetic field and arrange themselves in lines.
What kind of lines do you think would appear around a wire if you were to do the same experiment? Here’s where it’s a little different. You’re not going to see the same kinds of lines because the magnetic field doesn’t form along the wire. It forms around the wire.
The way this effect is normally used is by coiling the wires in lots of loops all in the same direction. This causes the magnetic field to bend around so that it’s going one direction inside the loops and the other direction outside the loops. It also concentrates the magnetic field and you can get a noticeable magnetic effect with current flowing through the looped wire.
This is called an electromagnet because it produces a magnetic field only when electricity is flowing. Listen to the full episode to learn about how this effect can be used by computers as well as to change AC voltages.