1. Magmatic crystallization: This is the process where molten rock (magma or lava) cools and solidifies. As the magma cools, minerals start to crystallize in a specific order depending on their melting points. This process can occur underground (forming intrusive igneous rocks like granite) or on the Earth's surface (forming extrusive igneous rocks like basalt).
2. Volcanic eruptions: When magma reaches the Earth's surface, it erupts as lava. This lava cools and solidifies quickly, forming extrusive igneous rocks.