The relative plate motion is accommodated by a variety of mechanisms. This includes, sea floor spreading, compression and deformation as well as horizontal displacements. Sometimes relative plate motion is accommodated slowly and smoothly. At other times, it may occur suddenly and rapidly, resulting in an Earthquake.
There are many different types of Earthquakes. Some Earthquakes occur in the crust and are associated with shallow-focus faults, while others occur deeper within the earth and are associated with deep-focus faults. Depending upon the focal depth, Earthquakes are classified as shallow (focal depth < 70 km), intermediate(70-300 km) or deep (> 300). Earthquakes may also occur as the result of other mechanisms such as volcanic eruptions, mining explosions, and even the impact of large meteorites.
However, the most common cause of Earthquakes is movement of tectonic plates. When plates move, the stress produced due to the grinding and sticking of the plates accumulates along the margins. When the stress reaches a critical level, the plates suddenly slip past each other releasing the built-up energy. This sudden release of energy causes seismic waves to be radiated which shake the crust, thus causing an Earthquake.