Formation of igneous rocks
1. Heat within the Earth causes rocks and other materials to melt forming magma
2. When magma rises during volcanic eruptions, some of the magma does not reach the surface of the Earth but instead slowly cools and hardens forming different kinds of igneous rocks
3. With favorable temperature and pressure conditions, the rocks containing metals melt and redeposit, eventually forming minerals