An earthquake occurs when layers of rock beneath the earth's surface rupture suddenly, releasing stored energy in seismic waves. These waves travel outward from the hypocenter, where the rupture initiates, marking the epicenter at the surface directly above. Several factors influence earthquake occurrence, including plate tectonics and the type and speed of seismic waves produced. Earthquakes are measured by both magnitude scales, indicating energy released, and intensity scales, describing perceived effects on people and structures.