Magma contains dissolved gases that are released into the atmosphere during eruptions. Gases are also released from magma that either remains below ground (for example, as an intrusion) or is rising toward the surface. In such cases, gases may escape continuously into the atmosphere from the soil, volcanic vents, fumaroles, and hydrothermal systems.
Volcanic gases undergo a tremendous increase in volume when magma rises to the Earth's surface and erupts. For example, consider what happens if one cubic meter of 900°C rhyolite magma containing five percent by weight of dissolved water were suddenly brought from depth to the surface. The one cubic meter of magma now would occupy a volume of 670 m3 as a mixture of water vapor and magma at atmospheric pressure (Sparks et. al., 1997)! The one meter cube at depth would increase to 8.75 m on each side at the surface. Such enormous expansion of volcanic gases, primarily water, is the main driving force of explosive eruptions.