Almost everyone is familiar with what a magnetic material can do but very few know how a magnet works. To understand this phenomenon one must first grasp the inextricable connection that exists between magnetism and electricity.
A simple electromagnet can be produced by wrapping copper wire into the form of a coil and connecting the wire to a battery. A magnetic field is created in the coil but it remains there only while electricity flows through the wire.
An ordinary bar magnet does not have an obvious connection with electricity so how does it work? The field created by the magnet is associated with the motions and interactions of its electrons, the minute charged particles which orbit the nucleus of each atom.
Electricity is the movement of electrons, whether in a wire or in an atom, so each atom represents a tiny permanent magnet in its own right. The circulating electron produces its own orbital magnetic moment, measured in Bohr magnetons (µB), and there is also a spin magnetic moment associated with it due to the electron itself spinning, like the earth, on its own axis (illustrated in figure 2). In most materials there is resultant magnetic moments, due to the electrons being grouped in pairs causing the magnetic moment to be cancelled by its neighbour.
Figure 2: The orbit of a spinning electron about the nucleus of an atom.
In certain magnetic materials the magnetic moments of a large proportion of the electrons align, producing a unified magnetic field. The field produced in the material (or by an electromagnet) has a direction of flow and any magnet will experience a force trying to align it with an externally applied field, just like a compass needle. These forces are used to drive electric motors, produce sounds in a speaker system, control the voice coil in a CD player, etc...
The interactions between magnetism and electricity are therefore an essential aspect of many devices we use every day.