The Earth’s outer shell is broken into plates that move slowly relative to each other. Where they meet, they stick, stress accumulates, and eventually the rock fails and slips. That release is an earthquake.
Why the mechanism is clear and timing is not
We know where the faults are, how fast the plates move, and roughly how much stress has accumulated since the last event. That supports statements about probability over decades.
What determines exactly when a fault fails is the detailed state of rock kilometres underground – its strength, fluid content, and stress distribution at scales we cannot measure. Small variations determine whether it slips today or in fifty years.
Why the search for precursors failed
Many phenomena have been proposed as warning signs – radon emissions, ground deformation, animal behaviour, small foreshocks. Each has appeared before some earthquakes and been absent before others, and appeared without an earthquake following.
After decades of investigation, no reliable precursor has been established.
What does exist
Early warning, which is different from prediction. Once an earthquake starts, the fastest seismic waves travel ahead of the destructive ones. Detecting the first and transmitting an alert electronically gives seconds to tens of seconds of warning.
That is enough to stop trains, close valves, and take cover. Several countries operate such systems.
What actually reduces harm
Building codes. The overwhelming majority of earthquake deaths are caused by buildings collapsing, and regions with enforced codes have far lower death tolls from comparable events.
That is unglamorous, expensive, and the only intervention that reliably works.