When a volcano erupts, the force of the expanding gases pushes magma from the magma chamber through the pipe until it flows or explodes out of the vent.
Magma is made up of molten rocks, minerals and trapped gases such as water vapor and sulfur dioxide. Under the Earth’s crust the rocks are held in liquid form under high pressure and temperature. As the magma rises the dissolved gases in the magma expands and the magma forces out of the magma chamber through a pipe and out the vent of a volcano as lava.