Answer:
Crystallization. Magma cools either underground or on the surface and hardens into an igneous rock. As the magma cools, different crystals form at different temperatures, undergoing crystallization. For example, the mineral olivine crystallizes out of magma at much higher temperatures than quartz.