Some, but not all, earthquakes are related to volcanoes. For example, most earthquakes are along the edges of tectonic plates. Most earthquakes directly beneath a volcano are caused by the movement of magma. The magma exerts pressure on the rocks until it cracks the rock.