Answer:

They had to live in the clefts of the valleys, In caves of the earth and the rocks (JOB 30:6).

GENESIS 8:319:301 KINGS 18:13JOHN 11:38

We find cave systems all over our country and the world. I believe most of these cave systems were formed over a short amount of time, not over thousands or millions of years. When we start with the Bible, we see that Noah’s flood created conditions that were just perfect for forming all kinds of intricate caves. The water covering the earth left thick layers of limestone and other layers. When the Flood ended, the mountains rose, the valleys sank, and the water flowed off the earth’s surface and seeped through the soft sediments. Because water can contain acid dissolved from the air and the soil, this would eat away at the limestone, forming caves. There are also other ways caves can be formed quickly. The dramatic events associated with the flood of Noah’s day provided excellent conditions for quick cave formation.

Source: https://answersingenesis.org/kids/geology/how-long-does-it-take-caves-to-form/