How does the principle of lateral continuity explain the relationship between rock layers in different locations?