How does magma become igneous rock?