Seismic waves are released during an earthquake. The three types of seismic waves generated in an earthquake are the primary wave, the secondary wave and the surface wave.
An earthquake occurs when stress from the Earth's tectonic plates is released. The zone where two tectonic plates meet is known as a fault. Tectonic forces cause a slow accumulation of strain energy stored on one side of the fault. The fault suddenly slips or ruptures when the local stresses along the fault become massive, releasing the stored strain energy in the form of seismic waves and heat. The resulting rupture on the fault plane is the focus, whereas its projection on the surface is the epicenter. Seismic waves spread away from the ruptured fault zone and disperse through the geologic layers of rock and soil. The ground shakes due to the process of seismic wave propagation.
The primary wave, or P wave, is the fastest seismic wave generated in an earthquake. This compression wave can move through solid and liquid rock and can also compress and expand matter as it moves through it. The secondary wave, or S wave, directly follows the P wave and travels through solid matter only. The surface wave is the slowest wave, and it moves on the outside surface or near the ground.