Lithifaction literally mean the formation of rock. Pressure and compaction due to burial provide the energy for sediment lithifaction.
The minerals that are deposited between grains are most commonly silica and calcite. The pore-space fluids may have been in the original sediment or may be from groundwater. If the rocks are buried more deeply, the minerals and fluid react to form brines.
Diagenesis is the term for the change in minerals that results in sedimentary rocks due to increased temperature, pressure, and interaction with brines. Thus, the transition from diagenesis to low-temperature metamorphism is gradual and thus the transition from sedimentary to metamorphic rocks can be blurred.