Sean's Blog

How Magnetism Works

July 26, 2026
Edit on GitHub

A permanent magnet is, in large part, a material whose electron magnetic moments have become ordered.

Electrons have both spin and orbital motion. Both can give an atom a magnetic moment. A quantum effect called exchange makes nearby moments prefer a shared order in some materials. The material then splits into domains. A magnet forms when enough of those domains point the same way.

That is the short answer. The full answer starts with what magnets do and ends with quantum fields.

What you see: fields, forces, and poles

A magnet creates a magnetic field around itself. The field assigns a direction and strength to each point in space. It tells us how a moving electric charge or another magnetic object will respond there.

Every bar magnet has a north and south pole. Opposite poles attract. Like poles repel. Cutting the bar in half does not isolate either pole. It makes two smaller magnets, each with its own north and south end.

Magnetic field lines therefore form closed loops. They leave the north end, curve through the space outside, enter the south end, and continue through the magnet. No experiment has yet found an isolated magnetic pole.

A compass needle turns because the field exerts a torque on its magnetic dipole. The needle settles in the direction that gives it lower energy. Two magnets attract or repel because their fields and dipoles seek a lower-energy arrangement.

An iron nail need not start as a magnet to feel attraction. A nearby magnet shifts its domains so that the closer end responds with the opposite pole. The pull on that near end exceeds the push on the farther end. The nail moves toward the magnet.

Moving charge produces magnetism

Electric current is moving charge, and moving charge creates a magnetic field. Bend a current-carrying wire into a loop and its field resembles that of a tiny bar magnet. Stack many loops into a coil and you get an electromagnet.

Special relativity joins electric and magnetic fields into one electromagnetic field. Observers moving at different speeds can divide that field into electric and magnetic parts differently. A force that looks purely electric in one frame can include a magnetic part in another.

This leads to the phrase "magnetism is electricity viewed through relativity." It contains real insight, but it does not explain a permanent magnet by itself. Permanent magnets also depend on intrinsic quantum spin and the collective behavior of many electrons.

Each atom can carry a magnetic moment

An electron has electric charge. Its orbital state around an atomic nucleus can give it orbital angular momentum and a magnetic moment.

An electron also has spin. The name is misleading. An electron is not a small charged ball turning around an axis. Spin is an intrinsic quantum property with no exact everyday match. It still carries angular momentum and a magnetic moment.

Atoms contain several electrons. Their spin and orbital moments add as vectors. Two electrons in a filled state often have opposite spins, so their spin moments cancel. Many atoms therefore have little or no lasting magnetic moment.

Atoms with unpaired electrons can retain a net moment. Iron, cobalt, nickel, and some of their alloys have the right electronic structure for strong magnetic order. Yet unpaired electrons alone do not make a permanent magnet. Oxygen has unpaired electrons, for example, but it is only weakly attracted to a field under ordinary conditions.

The missing part is an interaction that makes many atomic moments order together.

Why neighboring moments line up

The small magnetic fields of neighboring electron moments are too weak to explain ferromagnetism. The main cause is the exchange interaction.

Exchange is not a new force. It comes from the electric repulsion between electrons plus two quantum rules. Identical electrons share a joint wave function, and the Pauli exclusion principle limits which states they may share.

Changing the relative spin state changes the allowed spatial wave function. That changes how often electrons occupy nearby regions. Since electrons repel each other, the change also changes the energy.

In a ferromagnet, the material's electronic structure makes parallel order favorable across many atoms. The system lowers its energy when nearby moments point the same way. Exchange is strong enough to keep this local order despite room-temperature motion.

Parallel order is not the only result. In an antiferromagnet, neighboring moments prefer opposite directions and mostly cancel. In a ferrimagnet, opposing groups have unequal strength, leaving a net moment. The crystal structure and electron states decide which pattern wins.

So "spins align" describes the result. Exchange explains why.

Domains explain the whole object

Why is an ordinary piece of iron not always a strong magnet? Local alignment does not require the entire object to choose one direction.

A ferromagnet divides into regions called magnetic domains. Moments within one domain share a direction. Other domains point elsewhere. Their fields can largely cancel, leaving little net field outside the object.

This split saves energy. One huge domain would create a strong field far outside the material. Several domains reduce that field, though their boundaries also cost energy. The actual pattern balances exchange, crystal direction, shape, defects, and external fields.

Apply a strong field and domains already pointing near it grow. Domain walls move, while some moments rotate. Remove the field and defects can pin many walls in place. The object keeps part of its magnetization.

This memory is hysteresis. It explains why hard magnetic materials can become permanent magnets. Soft magnetic materials let domain walls move more easily, so they magnetize and demagnetize with little resistance. Transformers use soft magnets. Motors, speakers, and fridge magnets need harder ones.

What heating and cooling do to a magnet

Heat adds random motion and magnetic fluctuations. As temperature rises, those fluctuations fight the exchange-driven order.

At a material's Curie temperature, long-range ferromagnetic order disappears. Above that point, the material becomes paramagnetic. An applied field can still produce a weak alignment, but the material no longer sustains its own bulk magnetization.

The electrons do not lose their spin. Local magnetic moments can remain. What vanishes is their stable, large-scale order.

Cooling the material below the Curie temperature lets ferromagnetic domains form again. It does not reliably restore the old magnet. With no outside field, different regions choose different directions. Their fields may cancel, so the cooled object can have little net magnetization.

Cooling through the transition inside a strong field favors domains along that field. This can magnetize the material again. The final result also depends on its shape, crystal structure, defects, cooling rate, and magnetic history.

You do not always need to reach the Curie temperature to weaken a real magnet. Heat below that point can help domain walls escape their pinned positions. Strong opposing fields, shocks, and long-term aging can also reduce the stored alignment.

How superconductors fit in

A superconductor is not just a better ferromagnet. It is a different collective quantum state.

Below a critical temperature, a superconductor carries direct current with zero resistance. It also expels magnetic flux from its interior through the Meissner effect. Currents near its surface create a field that opposes the applied field.

This response is perfect diamagnetism. It does not come from permanent alignment of atomic moments. It comes from the shared quantum state of the charge carriers. Zero resistance alone cannot explain the expulsion of a field that was already present before cooling.

In conventional superconductors, lattice vibrations help electrons form Cooper pairs. Many pairs enter one coherent quantum state. A disturbance must break or excite that state before it can dissipate current.

Type I superconductors expel a field until the field becomes too strong and destroys superconductivity. Type II superconductors behave differently. Between two critical field strengths, magnetic flux enters through narrow quantum vortices while the rest remains superconducting.

Defects can pin those vortices. Flux pinning can hold a magnet at a stable height or lock it beneath a track. This produces the striking levitation demos often linked with superconductors.

A superconducting magnet is something else again. It is usually a coil made from superconducting wire. Its large, lasting current creates the field. The coil does not need ferromagnetic spin order. MRI scanners and particle accelerators use such coils because ordinary wire would waste far more energy as heat.

Too much heat, current, or magnetic field breaks the superconducting state. Conventional superconductors have a solid microscopic theory. Many high-temperature superconductors still lack a complete explanation.

The deepest useful picture

At the classical level, Maxwell's equations describe electric and magnetic fields. Special relativity shows that these fields are two parts of one object.

At the quantum level, charged particles and the electromagnetic field obey quantum electrodynamics. The electron's spin and magnetic moment arise naturally in relativistic quantum theory. Interactions with the quantized electromagnetic field can be described in terms of photons.

A block of iron, however, contains far too many interacting particles for that description to stay simple. Solid-state physics uses effective models for the collective behavior. Exchange interactions, energy bands, crystal symmetry, spin-orbit coupling, and thermal motion determine the magnetic phase.

This gives a useful chain of explanation:

  1. Electric charge and the electromagnetic field provide the basic interaction.
  2. Quantum theory gives electrons spin, orbital states, and magnetic moments.
  3. Pauli symmetry and electric repulsion produce exchange effects.
  4. Exchange can order moments inside a material.
  5. Domains control whether that order becomes a visible permanent magnet.
  6. Heat competes with the order and can erase its large-scale memory.
  7. Superconductors organize electrons in another way and push out or pin magnetic flux.

So the original idea is mostly right. Permanent magnetism does involve aligned electron spins. The alignment exists because quantum mechanics changes the energy of many-electron states. Domains then decide whether we can feel that order at the scale of a bar magnet.

References

  1. OpenStax: Magnetism in Matter
  2. OpenStax: Electron Spin
  3. Ferromagnetism
  4. OpenStax: Magnetic Fields Produced by Currents
  5. Physics Van: What Heating Does to a Magnet
  6. US Department of Energy: Superconductivity
  7. OpenStax: Superconductivity

#science