What makes a magnet work?
It's weird because the magnet is just a hunk of metal. It's not
doing anything special; it's not moving, yet it can affect and be affected
by other things.
To understand magnetism, we must start small. Really really small!
We must start with atoms.
Here is my crappy drawing
of an electron cloud around a nucleus.
Hopefully, you already know that atoms have tiny things called electrons
zipping all over. Some elements have an electron arrangement that
is a little unusual (Fe, Ni, Co, Gd).
Moving electrons are the equivalent of electricity.
When electricity moves, it creates magnetism. This means all
atoms are magnetic!
Usually, the motions of all of an atom's electrons cancels out this
effect.
But the 4 metals mentioned above have an unusual arrangement of electrons.
Their magnetism isn't all cancelled out. This means that every
atom of these elements is a tiny magnet!
The blue lines represent the magnetic field
of this atom. (it's really small!)
This means that any hunk of Iron you find could be a magnet.
But why isn't every piece of Iron a magnet? If you randomly drop
a million atoms into a pile, they won't all land the same way, so if you
make a hunk of steel from molten metal, chances are that it's not magnetic.
(see below)
Since each atom is has a tiny magnetic field around it, if you place
two atoms that have opposite fields next to each other, they negate each
other.

Here, these atoms do not work together because their magnetic fields
point in different directions.
But if they point in the same direction...
The fields add together and the resulting field is stronger.
A whole bunch of atoms in a group working together is called a domain.
There are millions and millions of domains in a chunk of steel. Usually
they don't work together, and the steel is non-magnetic.
But if they do all work together, the result is a magnet, with a magnetic
field that is strong enough to surround the chunk.
At least a thousand years ago, Chinese people were hanging natural
magnets they had found from threads as compasses which always pointed
North.