Although earthquakes often occur before a volcanic eruption, they are not the cause. The earthquakes are the result of magma (molten rock) moving underground leading up to an eruption. A few volcanic eruptions are thought to have been triggered or initiated by earthquakes, but this is not the typical case.