>>939361174
>The layers are formed over very long time periods, usually marked by different chemical compositions.
>So dirt just spontaneously forms over time, it doesn't have to come from anywhere?
Not spontaneously.
as an example: Chalk, and Limestone. which is formed from the remnants of shells of tiny marine organisms, which settle to the seabeds on death. with enough time, layers are compressed into rock.
Its even more pronounced in modern cities, where we are the ones dumping dirt on top of other stuff, again and again. dig 5 metres down in most european cities, and you'll find medieval buildings that the modern ones are simply built on top of. pic related, its an excavation in Paris in the '70s, you can see the buried buildings at the edge of the excavation.