How Do Magnets Work?
Few forces are as familiar yet as deeply puzzling as magnetism. You hold two magnets near each other and feel them snap together or push apart through empty air — an invisible force acting across empty space. It feels almost magical. But magnetism is one of the most fundamental aspects of the quantum nature of matter, rooted in the behavior of electrons deep inside atoms.
The Classical Picture: Field Lines
The traditional description of a magnet involves magnetic field lines that emerge from the north pole, arc through space, and re-enter at the south pole. These field lines describe the direction a free north magnetic pole would move at any point in space — which is the direction a compass needle points.

Like poles repel; opposite poles attract — a consequence of the direction of force along these field lines. But this description tells us where the field goes, not what creates it. For that, we need to go inside the atom.
The Quantum Origin: Electron Spin
Magnetism in matter comes primarily from two quantum properties of electrons:
1. Orbital angular momentum: Electrons occupy quantum mechanical orbitals around the nucleus. A moving charge creates a magnetic field (per Maxwell's equations), so this motion produces a small magnetic dipole moment for each electron.
2. Spin: Electrons possess an intrinsic angular momentum called spin, which is a purely quantum mechanical property with no classical analogue. Despite this, spin acts exactly like a rotating charge: each electron has a magnetic moment due to spin of one Bohr magneton ( J/T), either pointing "up" or "down."
In most atoms, electrons fill orbitals in pairs with opposite spins — their magnetic moments cancel exactly. Unpaired electrons are the source of an atom's net magnetic moment. Hund's rule (from quantum mechanics) dictates that electrons fill an energy shell with parallel spins before pairing — maximizing the number of unpaired electrons and thus the magnetic moment per atom.

Iron (Fe) has 4 unpaired 3d electrons per atom. Nickel has 2. Cobalt has 3. These elements in the 3d transition series have partially filled d-shells — the conditions for strong magnetic moments.
Magnetic Domains: From Atoms to Bulk
A single iron atom has a strong magnetic moment, but a freshly made piece of iron may be completely non-magnetic. Why? Because of magnetic domains.
A domain is a microscopic region (typically 0.01–1 mm) inside a ferromagnetic material where all the atomic magnetic moments are aligned in the same direction. But across domain boundaries, the orientation changes. In an unmagnetized piece of iron, countless domains point in random directions — their fields cancel out, and the bulk material has no net magnetization.

When you apply an external magnetic field, two things happen:
- Domain wall motion: Domains aligned with the field grow, consuming neighboring domains that are aligned differently.
- Domain rotation: Domains whose alignment is far from the field's direction may rotate all at once.
When the field is removed, domains may partially or fully retain their new alignment — this is how a permanent magnet is created. Hitting a magnet hard with a hammer, or heating it, can randomize the domains again and demagnetize it.
Types of Magnetic Ordering
Not all magnetic materials are the same. The key question is how neighboring atomic moments interact:
| Type | Description | Example | Net Magnetization |
|---|---|---|---|
| Ferromagnet | All moments aligned same direction | Fe, Ni, Co | Strong |
| Antiferromagnet | Adjacent moments alternate direction | MnO, Cr | Zero |
| Ferrimagnet | Alternating moments of unequal size | Fe₃O₄ (magnetite) | Weak |
| Paramagnet | Random moments, alignable by field | Al, Pt | Zero at rest |
| Diamagnet | Opposing induced moments | Cu, water, bismuth | Weak, repels fields |
The difference between ferromagnets and antiferromagnets is the exchange interaction — a quantum mechanical effect that determines whether neighboring spins prefer to be parallel or antiparallel. In iron, cobalt, and nickel, the exchange interaction strongly favors parallel alignment — ferromagnetism. In many transition metal oxides, it favors antiparallel — antiferromagnetism.
The Curie Temperature
The domain structure and ordered alignment only survive below a critical temperature called the Curie temperature (named for Pierre Curie, who discovered it in 1895). Above this temperature, thermal energy overcomes the exchange interaction and scrambles the spin alignment. The material becomes paramagnetic — it can be temporarily magnetized by an external field but retains no permanent magnetization.

| Material | Curie Temperature |
|---|---|
| Cobalt (Co) | 1,388 K (1,115 °C) |
| Iron (Fe) | 1,043 K (770 °C) |
| Nickel (Ni) | 627 K (354 °C) |
| Gadolinium (Gd) | 292 K (19 °C) |
Gadolinium is ferromagnetic just below room temperature — it becomes non-magnetic on a warm day, which makes it useful for certain magnetic refrigeration applications.
Rare-Earth Magnets
The strongest permanent magnets available today are made from rare-earth elements, which have partially filled 4f electron shells — deeper inside the atom than the 3d shells of iron and nickel. This gives them exceptionally strong spin-orbit coupling and very high magnetocrystalline anisotropy (strong preference for magnetization along particular crystal axes), making them very difficult to demagnetize.
The two dominant types:
Samarium-cobalt (SmCo): High performance at elevated temperatures; used in aerospace and military applications.
Neodymium-iron-boron (NdFeB): The strongest commercially available permanent magnet material. A magnet the size of a coin can lift many kilograms. Used in hard drives, headphones, electric motors in EVs, wind turbine generators, MRI machines, and loudspeakers.
The magnetic equation governing the force between two magnetic poles:

where and are the magnetic pole strengths, is the separation, and T·m/A is the permeability of free space — a fundamental constant of electromagnetism.
Magnetism and special relativity are deeply connected. What we call magnetism is, in part, an electric field viewed from a different reference frame. A stationary charge creates no magnetic field. But a charge moving past you — or you moving past a stationary charge — is a current, and all currents create magnetic fields. This equivalence between electricity and magnetism, made precise by special relativity and unified by Maxwell's equations, is one of the cornerstones of modern physics.