Earthquakes occur along plate boundaries due to the buildup and sudden release of energy from shifting tectonic plates. When plates lock, potential energy builds until released as seismic waves that propagate outward from the earthquake focus. Most earthquakes occur along oceanic and continental plate edges or along faults like normal, reverse, and transform boundaries. P and S waves are the primary seismic waves, with P waves traveling faster and S waves causing the shaking felt during quakes. Earthquake magnitude measures the energy released using the Richter scale, while intensity qualitatively describes the shaking effects on a place using the Mercalli scale.