The interior of the Earth is hot enough to melt rock, and that's just what happens. Melted rock squeezes together into vast pools of magma beneath the ground. Over long periods of time, erosion wipes away the outer layers of the mountain, exposing the dome-shaped cooled magma of harder rock.