Cementation

Cementation is what makes rocks solid. It is the process where grains of sediment get stuck together. It is a chemical process, and the cement is a precipitate which crystallises in the spaces between the matrix of grains. Silica (SiO2) and calcium carbonate (CaCO3) are the most common types of cement.
Ions carried in groundwater precipitate to form new crystalline material in sediment pores: this is how "sediment" becomes "rock". The new pore-filling minerals form "bridges" between original sediment grains, thereby binding them together. So "sand" becomes "sandstone", and "gravel" becomes "conglomerate". 
Cementation occurs mainly below the water table. Large volumes of pore water must pass through sediment pores for new mineral cements to crystallize and so millions of years are generally required to complete the cementation process. 
Sedimentation does not always occur. Many quarries used for sand and gravel have them as loose particles and stones, just as if they came from a present-day beach. In England, most of these quarries are from beds laid down in the Jurassic, 150+ million years ago. By chance, the conditions for cementation never occurred there.