How Magnets Actually Work: The Quantum Origin of Magnetism
Magnets stick to your fridge because of quantum mechanics. Not chemistry, not classical physics — electron spin, exchange interactions, and domain alignment. The real explanation is stranger and more beautiful than most people realise.
Table of Contents
The Honest Answer Is Weird
If someone asks you how magnets work, the honest answer is quantum mechanics. Not “tiny magnetic particles.” Not “invisible field lines.” Not “north and south poles attract.” Those are descriptions of what magnets do, not explanations of why they do it. The actual mechanism — the reason a lump of iron can stick to your fridge and hold up a shopping list against gravity — is rooted in the quantum mechanical spin of electrons and a phenomenon called the exchange interaction that has no classical analogue whatsoever.
I want to walk through this properly, because I think magnetism is one of those things that most people accept without understanding, and the real explanation is far stranger and more satisfying than the hand-wavy version.
Every Electron Is a Tiny Magnet
Start here. Every electron in the universe has a property called spin. This is not the electron physically rotating — electrons, as far as we can tell, are point particles with no spatial extent, so there’s nothing to rotate. Spin is an intrinsic quantum mechanical property, like charge or mass. It just exists. An electron has spin, and that spin gives it a magnetic moment — it behaves exactly like an infinitesimally small bar magnet, with a north and south pole.
The spin magnetic moment of a single electron is about 9.28 × 10⁻²⁴ joules per tesla. That’s absurdly tiny. You’d never notice it. But atoms have many electrons, and in certain materials, the spins of those electrons can add up.
Electrons also have orbital magnetic moments from their motion around the nucleus. An electron orbiting a nucleus is, in classical terms, a tiny current loop — a moving charge creates a magnetic field. The orbital contribution matters, but in ferromagnetic materials (the ones that make strong permanent magnets), the spin contribution dominates. So let’s focus on spin.
In most atoms, electrons come in pairs with opposite spins — one “spin up,” one “spin down.” The Pauli exclusion principle demands this: two electrons in the same orbital must have opposite spins. Paired spins cancel each other’s magnetic moments. No net magnetism. This is why most materials aren’t magnetic. Carbon, oxygen, copper, gold — their electrons are all neatly paired, and the magnetic moments cancel to zero or near-zero.
But some elements have unpaired electrons. Iron has four unpaired electrons in its 3d shell. Cobalt has three. Nickel has two. Each unpaired electron contributes a net magnetic moment. So iron atoms, cobalt atoms, and nickel atoms are each tiny magnets. Good start — but not enough. Having magnetic atoms doesn’t automatically give you a magnet. You need those atomic magnets to cooperate.
The Exchange Interaction: Quantum Cooperation
Here’s where it gets properly quantum mechanical. And honestly, I think this is one of the most remarkable phenomena in all of physics.
In a solid, atoms are packed close together — typically separated by a few ångströms (10⁻¹⁰ m). At these distances, the electron clouds of neighbouring atoms overlap. The electrons are not just orbiting their own nuclei — they’re shared, delocalised, spread across multiple atoms. And because electrons are fermions (particles with half-integer spin), they obey the Pauli exclusion principle and quantum statistics that have no classical parallel.
The exchange interaction arises from the combination of electrostatic repulsion between electrons and the Pauli exclusion principle. Here’s the essence: two neighbouring electrons with parallel spins (both “up” or both “down”) must occupy different spatial orbitals (Pauli says they can’t be in the same state). This keeps them farther apart on average, reducing their electrostatic repulsion energy. Two electrons with anti-parallel spins can occupy the same spatial orbital, bringing them closer together and increasing their repulsion.
So in certain materials — and this is the critical part — electrons can lower the total energy of the system by aligning their spins parallel. Not because the magnetic forces between them are strong (they’re not — magnetic dipole-dipole interactions are far too weak to explain ferromagnetism), but because the quantum mechanical exchange effect makes parallel alignment electrostatically favourable.
This is genuinely strange. The force that aligns electron spins in a magnet is not magnetic. It’s electrostatic — it’s the Coulomb repulsion between electrons, modified by quantum statistics. Magnetism, at its deepest level, is an electrostatic phenomenon wearing a quantum disguise.
The exchange interaction is incredibly short-ranged — it only works between nearest-neighbour atoms where electron clouds overlap. But in iron, cobalt, and nickel, the crystal structure and the 3d electron configuration produce a positive exchange constant, meaning parallel alignment is energetically favoured. In other elements, the exchange constant is negative (anti-parallel is favoured, giving antiferromagnets like chromium) or negligible.
Magnetic Domains: Order, but Not Everywhere
If the exchange interaction forces neighbouring spins to align, why isn’t every piece of iron automatically a magnet? You’ve handled plenty of iron objects that aren’t magnetic. Nails, pans, car parts. Not magnetic. Why not?
Because of domains.
The exchange interaction wants all spins aligned. But there’s a competing effect: if an entire chunk of iron were magnetised as one single domain, it would create a strong magnetic field extending into the space around it. Maintaining that external field costs energy — magnetostatic energy. The system can lower this energy by breaking into smaller regions — domains — each magnetised in a different direction. The domains’ fields partially cancel each other, reducing the external field and the associated energy.
A typical unmagnetised piece of iron contains millions of domains, each a few micrometres to a few millimetres across. Within each domain, the spins are beautifully aligned — the exchange interaction ensures this. But the domains themselves point in different directions, and their fields largely cancel. The net external magnetic field is zero or near-zero. The iron is not magnetic on a macroscopic scale, even though it’s magnetic on a microscopic scale.
To make a permanent magnet, you need to align the domains. Apply a strong external magnetic field, and domains aligned with the field grow (their boundaries shift) while domains opposing the field shrink. In a soft magnetic material like pure iron, the domains pop back to their original random arrangement when you remove the external field. In a hard magnetic material like neodymium-iron-boron, the crystal structure pins the domain walls in place, locking in the alignment. The magnet retains its magnetisation permanently — or at least until you heat it past the Curie temperature.
Why Only a Few Elements?
It’s worth pausing on how selective ferromagnetism is. Of the 118 known elements, only three are strongly ferromagnetic at room temperature: iron, cobalt, and nickel. That’s it. Three.
Gadolinium is ferromagnetic too, but its Curie temperature is 20 °C — it loses its ferromagnetism just above room temperature. A few other rare earth elements are ferromagnetic at very low temperatures. But for practical magnets at everyday temperatures, you’re limited to iron, cobalt, nickel, and their alloys.
The reason is that ferromagnetism requires a very specific combination of conditions. You need unpaired electrons in the right orbitals (partially filled d or f shells). You need the right interatomic spacing so that electron cloud overlap produces a positive exchange constant. And you need the thermal energy at room temperature to be low enough that it doesn’t disorder the spin alignment (the Curie temperature must be above ~300 K).
This is remarkably restrictive. Change the interatomic spacing by 10–20%, and the exchange constant can flip from positive to negative — from ferromagnet to antiferromagnet. Manganese, for example, has five unpaired 3d electrons (more than iron!), but its crystal structure gives it a negative exchange constant. It’s antiferromagnetic, not ferromagnetic. More unpaired electrons, worse magnet. The quantum details matter enormously.
Neodymium Magnets: Engineering the Quantum
The strongest permanent magnets commercially available are neodymium-iron-boron (Nd₂Fe₁₄B) magnets. They can produce surface fields of 1.2–1.4 Tesla — strong enough to be genuinely dangerous if you get your fingers caught between two large ones.
Why are they so much stronger than plain iron magnets? Two reasons. First, the neodymium atoms contribute additional magnetic moment from their 4f electrons, adding to the iron’s contribution. Second — and more importantly — the crystal structure of Nd₂Fe₁₄B has very high magnetocrystalline anisotropy. This means the crystal structure strongly prefers magnetisation along one particular crystal axis, making it extremely hard to demagnetise. The domain walls are pinned firmly by the crystal’s anisotropy energy, so once you magnetise a neodymium magnet, it stays magnetised.
This anisotropy is what distinguishes a hard magnet (permanent) from a soft magnet (temporary). Soft iron has low anisotropy — domains can rotate easily, so it magnetises and demagnetises freely. Nd₂Fe₁₄B has enormous anisotropy — domains are locked in place, making it a superb permanent magnet but a terrible electromagnet core (you can’t easily switch it on and off).
Every MRI machine, every electric vehicle motor, every hard drive, every pair of earbuds with a speaker in it — neodymium magnets. The global supply is dominated by China, which controls roughly 60% of rare earth mining and 90% of rare earth processing. That’s not physics. That’s geopolitics. But it matters.
The Curie Temperature: Where Order Dies
Heat a magnet and something interesting happens. At first, not much — the magnet weakens slightly as thermal vibrations jostle the spins. But at a specific temperature — the Curie temperature — the magnet dies. Not gradually. Sharply. It’s a phase transition, analogous to ice melting, except instead of solid-to-liquid, it’s ordered-magnetic to disordered-paramagnetic.
For iron, the Curie temperature is 770 °C. Below this, the exchange interaction wins — spins stay aligned within domains, and the material is ferromagnetic. Above it, thermal energy overwhelms the exchange interaction, spins randomise, domains dissolve, and the material becomes paramagnetic — only weakly and temporarily magnetic when placed in an external field.
This is a second-order phase transition. There’s no latent heat (unlike melting). The magnetisation decreases continuously as temperature rises and reaches zero at T_C. The physics near the Curie temperature is deeply connected to critical phenomena and universality classes — the same mathematical framework that describes phase transitions in fluids, superfluids, and even the early universe.
Cool the iron back below 770 °C and domains reform. But they reform in random orientations — the information about the previous domain alignment is lost. To re-magnetise, you need an external field again. Heat is the enemy of permanent magnets, and every magnet application must account for this. Electric motors, which generate significant heat during operation, use magnets with high Curie temperatures or active cooling to prevent demagnetisation.
The Deepest Part
Richard Feynman famously deflected a question about how magnets work by saying, essentially, that the honest answer requires quantum electrodynamics and can’t be reduced to everyday intuition. He was right. The exchange interaction — the actual mechanism responsible for ferromagnetism — is a purely quantum effect with no classical analogue. You cannot explain it with bar magnets and field lines. You cannot explain it with analogies to anything in everyday experience. It emerges from the interplay of electrostatic forces and quantum statistics, and it only works because electrons are indistinguishable fermions obeying the Pauli exclusion principle.
I think that’s actually what makes magnetism so wonderful. It’s an everyday phenomenon — you use it to stick notes on your fridge — that is, at its core, irreducibly quantum mechanical. You cannot derive ferromagnetism from classical physics. Bohr and van Leeuwen proved this in 1919: in a classical system, the thermal average of magnetisation is always exactly zero, regardless of the applied field. Classical physics predicts that permanent magnets cannot exist.
And yet here’s one, holding up your shopping list. Quantum mechanics at room temperature, on your refrigerator door, working so reliably that you never think about it.
That’s how magnets work.
Frequently Asked Questions
What actually causes magnetism?
Magnetism ultimately comes from moving electric charges — specifically, from two quantum mechanical properties of electrons. First, electrons orbiting atomic nuclei create tiny current loops that generate magnetic fields (orbital angular momentum). Second, each electron has an intrinsic quantum property called spin, which makes it behave like a tiny bar magnet even though nothing is physically spinning. In most materials, these tiny magnetic moments point in random directions and cancel out. In ferromagnetic materials like iron, cobalt, and nickel, a quantum effect called the exchange interaction forces neighbouring electron spins to align parallel to each other, creating regions (domains) with a net magnetic field. When enough domains align in the same direction, the material becomes a macroscopic magnet.
Why do magnets attract iron but not copper or aluminium?
It comes down to electron configuration. Iron, cobalt, and nickel have partially filled 3d electron shells with unpaired electrons whose spins can align cooperatively through the exchange interaction — this makes them ferromagnetic. Copper has a full 3d shell with all electrons paired (spins cancel), so there's no net magnetic moment to align. Aluminium is actually weakly attracted to magnets (it's paramagnetic), but the effect is roughly 100,000 times weaker than in iron and completely undetectable without sensitive instruments. The specific quantum mechanical conditions for ferromagnetism — unpaired d-electrons, the right interatomic spacing for positive exchange coupling — are quite rare, which is why only a few elements are strongly magnetic.
Can you make a magnet stronger?
Up to a point, yes. A magnet's strength depends on how well its magnetic domains are aligned. You can improve alignment by stroking the material with another strong magnet (physically aligning domains), by placing it in a strong external magnetic field (the standard industrial magnetisation process), or by cooling it (thermal energy works against domain alignment). However, every magnetic material has a saturation magnetisation — the maximum field strength when all domains are perfectly aligned. Beyond that, no technique can make it stronger without changing the material itself. The strongest permanent magnets today are neodymium-iron-boron (NdFeB) alloys, producing fields of about 1.2–1.4 Tesla at their surface.
Why do magnets lose their magnetism when heated?
Heating a magnet adds thermal energy to the atoms, causing random vibrations that disrupt the alignment of electron spins within magnetic domains. As temperature increases, more and more spins flip to random orientations, weakening the net magnetisation. At a critical temperature called the Curie temperature — 770 °C for iron, 1,115 °C for cobalt, 358 °C for nickel — the thermal energy completely overwhelms the exchange interaction, and all long-range spin order is destroyed. The material becomes paramagnetic: weakly and temporarily magnetic only in the presence of an external field. Cool it back down and the domains can re-form, but they'll be randomly oriented unless an external field guides them.
Do magnets ever wear out?
Very slowly, yes. Permanent magnets gradually lose strength over time through a process called magnetic relaxation — thermal fluctuations occasionally flip the magnetisation of small regions within domains, slightly reducing the overall alignment. For high-quality magnets at room temperature, this loss is extremely slow: a neodymium magnet might lose about 1% of its field strength over a decade under normal conditions. Dropping, heating, or exposing a magnet to opposing magnetic fields accelerates the loss by physically or thermally disrupting domain alignment. For practical purposes, a well-treated permanent magnet lasts effectively forever in everyday applications.
How do electromagnets work differently from permanent magnets?
An electromagnet creates a magnetic field by running electric current through a coil of wire. Moving charges create magnetic fields — this is Ampère's law, one of Maxwell's equations. The field exists only while current flows; turn off the current and the field disappears. The strength is adjustable by changing the current. A ferromagnetic core (usually soft iron) inside the coil dramatically amplifies the field because the core's magnetic domains align with the coil's field, adding their own contribution. Permanent magnets, by contrast, maintain their field without any external power because their domain alignment is locked in place by the crystal structure and the exchange interaction. Electromagnets are controllable; permanent magnets are persistent.