Hi Dan, Good question. The style of volcanism is controlled by the tectonic setting and the composition of the magma. Volcanoes also form above hot spots, stationary upwellings of hot mantle rocks. Basalt has a relatively low viscosity and most gas escapses before the eruption starts. Explosive, violent eruptions are associated with andesite magma produced at subduction zones and released as tephra at stratovolcanoes.
Gas stays traps in the magma until it violently expands, driving the eruption.