A volcano erupts when the pressure of a subterranean pool of magma becomes great enough to crack the earth's crust. Whether the eruption results in a violent explosion or a slow seepage depends on several different factors, according to How Stuff Works.
Molten rock, called magma, forms underground when Earth's tectonic plates collide or move apart, or when activity within the mantle, a very hot layer beneath the earth's crust, causes the crust to melt. Magma contains dissolved gases that remain dissolved as long as the pressure of the gas is not greater than the confining pressure of the solid rock around it. If the vapor pressure becomes great enough, the gas forms small bubbles within the magma. These bubbles are less dense than the surrounding magma, so they push upward to escape it, and an eruption occurs. The composition of the magma is an important factor in determining the force of this eruption. If it contains larger amounts of gas, it erupts more violently. Another factor is the viscosity of the magma. Magma with a high viscosity resists flowing, and the gas bubbles must forcefully push out more material to escape. On the other hand, magma with a low gas content and low viscosity is likely to result in a slow, non-explosive eruption.
Volcanic eruptions can occur without any prior warning, making them hard to predict. Understanding how a volcano works and how its eruptions can be predicted is important to the preservation and well-being of the inhabitants of volcanically vulnerable areas. There are three main classifications of volcanoes. Active volcanoes have recently erupted, dormant volcanoes have not erupted in a long while but are likely to erupt in the future and extinct volcanoes have not erupted in a long while and are not expected to erupt in the future.