Volcanoes erupt when molten rock, or magma, emanates through weak spots in the crust of Earth because it's low in density than the surrounding rock. When magma gathers in underground chambers, gases like water vapour, sulphur dioxide and carbon dioxide build up, increasing pressure. When this pressure exceeds the strength of the overlying rock, it bursts out as an eruption.