On the surface, weathering and erosion break down the igneous rock into pebbles, sand, and mud, creating sediment, which accumulates in basins on the Earth's surface. As successive layers of sediment settle on top of one another, the sediment near the bottom is compressed, hardens, and forms sedimentary rock.