Sedimentary rocks have layers because of different depositions of sediments (small broken pieces of rocks) over time. The different groups of sediments could have been deposited through wind, water, ice, and/or gravity at different intervals of time and compacted on top of each other, until they create a sedimentary rock that has several different types of sediments (possibly from different rock types) in the form of layers.