Cementation is the name of the process that glues minerals into sedimentary rock. Another process, compaction, also causes matter that settles in layers to transform into sedimentary rock. Compaction and cementation are known together as sedimentation.
The process starts with erosion of rock and follows it with deposition of matter. Mud, sand, smaller rocks, leaves, sticks and remains of other living things settle in layers. These things fit loosely at first, but layers build up over a period of time, pressing down on lower layers and compacting them.
During compaction, minerals in the mix are being dissolved. Over time, these minerals fill in any empty spaces in the layered material. Cementation takes place when sediments are glued tightly together by precipitation.