Earthquakes can occur when plate boundaries shift suddenly along a fault and release their stored energy.