Compaction is the process by which sediments are mechanically compressed under the weight of overlying materials, reducing their volume and increasing their density. This process plays a crucial role in the formation of sedimentary rocks and influences the porosity and permeability of geological formations.