what happens when magma cools

just now 1
Nature

When magma cools, it begins to crystallize and solidify into igneous rock. The cooling process causes minerals to form crystals in a specific sequence based on temperature—starting with minerals rich in calcium, iron, and magnesium, and then progressing to those rich in aluminum, potassium, and sodium. The rate of cooling determines the size of the crystals: slow cooling underground results in large crystal formations, producing coarse-grained igneous rocks, while rapid cooling, such as when magma erupts as lava on the surface, forms fine-grained or glassy textures with small or no crystals. Sometimes rapid cooling leads to volcanic glass like obsidian, which lacks crystal structure entirely. This crystallization process shapes the texture and composition of igneous rock and influences the formation of valuable minerals.