Sedimentary rocks are formed from the accumulation and lithification of sediment – fragments of pre-existing rocks, minerals, or organic matter. Over vast stretches of time, these layers are compacted and cemented by natural processes like Compaction and Cementation, preserving clues to Earth's ancient environments.