Earthquakes happen when tectonic plates slip. Tectonic plates are constantly moving over or horizontally past one another. As a result, the rocks from the plates get caught on each other and generate friction. The strain eventually overrides the elasticity of the rocks, which results in the release of stress, leading to a shaking motion on the surface.