Earthquakes occur because of the movement of tectonic plates moving towards each other or sliding past each other. As they converge or slide past each other, they have rough edges so they stick in one position and then they lock or jam. As they try to move away from each other great stress and pressure build up. Heat is generated due to friction. Eventually, that great pressure is then released and sends out vibrations and shock waves called seismic waves out into the earth.