Volcanoes occur when plates collide or separate magma from the magma chamber rises and fills the space of the Vent. Magma also heats up during this process, when magma reaches the surface it creates an opening of the crafter. When magma cools and hardens is turned into lava. After a lot of eruptions old layers of ash and rock form and create the code.