It was once a basin. Hence, the deposition of sand, shale, and limestone.
Where did the organic material come from up there?