James David Lewis-Williams said this quote

Entering a cave” or rock was a metaphor for a shaman’s altered state; therefore, caves (and rocks more generally) were considered entrances or portals to the supernatural world.