Here's a breakdown:
* Loose materials: These can include sand, silt, clay, pebbles, shells, or even fragments of other rocks.
* Compaction: Over time, the weight of overlying layers presses down on the loose materials, squeezing out water and air, causing the particles to become tightly packed.
* Cementation: Minerals dissolved in groundwater precipitate between the particles, acting like glue to bind them together.
This process is called lithification, and it is how sedimentary rocks are formed.