Igneous rocks form when magma or lava cools and hardens. They can form inside Earth's interior as intrusive igneous rocks or outside Earth's surface as extrusive igneous rocks. The texture of igneous rocks depends on the rate of cooling - slow cooling leads to large crystal grains as in intrusive rocks, while rapid cooling of lava produces extrusive rocks with small or no crystal grains.