Earthquakes occur when energy stored in Earth's crust is suddenly released, causing seismic waves. The focus is where the seismic waves originate underground, and the epicenter is the point directly above on the surface. There are three main types of seismic waves - P waves, S waves, and L waves - which travel outward from the focus. Earthquakes are measured by their magnitude, which indicates the amount of energy released, and by their intensity, which describes the observed effects on people and structures.