An earthquake is the result of two tectonic plates coming together and colliding. As the plates grind against each other, friction builds up between the two rock masses. Over time, as the plates continue to move, the pressure increases, eventually making them move very suddenly, releasing a lot of energy. This energy is released as seismic waves which move through the rocks like waves in the ocean. It is these seismic waves that cause shaking vibrations of the earth and cause so much damage in an earthquake.