Volcanic eruptions can be explosive, sending ash, gas and lava high up into the atmosphere, or the magma can form lava flows, known as effusive eruptions. Whether an eruption is explosive or effusive largely depends upon the amount of gas in the magma.
If a lot of gas is trapped within magma, pressure will build and build until eventually the magma erupts explosively out of the volcano. It’s a bit like a bottle of fizzy pop: gas is trapped in the liquid but if you shake the bottle the gas wants to escape. This builds pressure inside the bottle and when you release the pressure by opening the bottle, the gas rushes out of the top carrying some of the liquid with it.
Phreatomagmatic eruptions are a type of explosive eruption that results from magma erupting through water. The second phase of the Eyjafjallajökull eruption in 2010 was phreatomagmatic as a result of magma erupting under ice. Some submarine volcanoes are phreatomagmatic if the magma is gas-rich, for example Surtsey in Iceland. This eruption formed a new island.
Explosive eruptions can form pyroclastic flows that sweep down valleys, destroying everything in their path. They also send ash high into the atmosphere, forming plumes.
If a magma has low viscosity (it is runny), gas can escape easily, so when the magma erupts at the surface it forms lava flows. These eruptions are (relatively!) gentle, effusive eruptions. If a magma rises very slowly within the conduit. or throat, of the volcano, all the gas can escape. When the magma is viscous (or sticky), it can’t flow when it reaches the surface, so it builds up forming a lava dome.