The concept would be crystallization. As magma cools inside or outside of the earth it crystallizes into an igneous rock. Intrusive (formed inside crust) igneous rocks are typically more course grained and contain many different noticeable minerals (for example, granite). Extrusive (formed outside) igneous rocks are typically more porous and are more fine grained then intrusive rocks (example, obsidian).