Earthquakes are caused by the sudden release of energy from the breaking of rocks deep in the earth. The elastic rebound theory explains how stress builds up in rocks until it exceeds the rocks' strength, causing rupture and the release of seismic waves. The focus is the point where faulting begins underground, and the epicenter is the point directly above on the surface. Most earthquakes occur along plate boundaries and are mapped using seismic wave arrival times at multiple stations. Earthquake size is measured by both intensity scales based on damage, and by magnitude scales measuring the total energy released.