Mountains of Fire
A volcanic eruption is one of nature's most powerful and dramatic events. Glowing molten rock, towering clouds of ash, and rivers of lava have fascinated and frightened people throughout history. A volcano can sit quietly for many years and then suddenly burst into life. To understand why volcanoes erupt, we need to look deep beneath the Earth's surface, where intense heat creates the fuel for every eruption.
Magma Deep Below
Far below the ground, the Earth is extremely hot, hot enough that some rock melts into a thick, fluid substance called magma. This molten rock is one of the most important ingredients of a volcano. Crucially, magma is less dense, meaning lighter, than the solid rock surrounding it. Just as a bubble of air rises through water, the lighter magma slowly rises upward through the Earth, seeking cracks and weak points, and often collecting in large underground spaces called magma chambers.
Building Pressure
As magma gathers in a chamber, pressure begins to build. A major reason for this is gas. Magma contains dissolved gases, much like the carbon dioxide dissolved in a fizzy drink. Deep underground, the enormous weight of rock above keeps these gases trapped within the magma. But as more magma rises and fills the chamber, and as the magma moves toward the surface, the pressure inside builds up more and more, straining against the rock that holds it back.
The Eruption
Eventually the pressure becomes too great for the surrounding rock to contain. The magma forces its way through cracks and vents and bursts out at the surface, and this is a volcanic eruption. Once magma reaches the surface, it is called lava. How violent an eruption is depends largely on the magma. Thin, runny magma lets gas escape gently, producing flowing rivers of lava. Thick, sticky magma traps gas until it escapes in a sudden, explosive blast, throwing ash and rock high into the sky.
Source
This article was written using information from Wikipedia.