Moving plates
The Earth's rigid outer shell is broken into tectonic plates that drift a few centimetres a year. Where they meet, they grind, pull apart or collide. Stress builds up along faults until the rock suddenly slips — releasing energy as seismic waves. That is an earthquake.
Why some places more than others
Most earthquakes cluster along plate boundaries: the Pacific 'Ring of Fire', the Mediterranean–Himalayan belt and mid-ocean ridges. Chile, Japan and Indonesia sit on subduction zones and shake constantly; the middle of plates is far quieter.
Foreshocks and aftershocks
A big quake rarely comes alone. Smaller foreshocks sometimes precede it, and aftershocks — which can last weeks — follow as the crust settles into its new position.