More plants and animals died and fell down, more sand and mud fell down too. This was repeated and everything gets compressed. If you compress mud enough, it become a rock called shale. If you compress animal shells enough, they become a rock called limestone. All three kinds are called sedimentary rocks, and whenever you find them, you can be sure that once they were at the bottom of a sea, lake or river.
Some sedimentary rocks can be porous.
These are called porous rocks. Rocks without these tiny holes are called impervious. For millions and millions of years, the rocks in the Devonian reef were covered with more layers of sand, and mud, and animals and plants. Now they are far below the surface. No one really knows how these plants and animals changed into oil when they were buried deep under the ground, but somehow it happened.