Diagenesis and Lithification
Loose grains are called sediment
Sediment can be converted to sedimentary rock if the particles are either cemented together or compacted during burial.
As sediment is buried, changes in composition and texture may take place and sedimentary processes merge with metamorphc