It's called the Principle of Original Horizontality
it just means what it sounds like: that all rock layers were originally horizontal.
Of course, it only applies to sedimentary rocks.
Recall that sedimentary rock is composed of sediments, which are deposited and compacted in one place over time.