Earthquakes happen when rocks on either side of a tectonic fault shift suddenly in opposite directions. Two main seismic waves that carry shaking out of a breaking fault are "S" waves, which shear rocks and propagate at about 3.5 km/s, and "P" waves, which compress rocks and propagate faster at about 5 km/s.