Caves were a problem during the 1556 earthquake in Shanxi, China.
I was sent to Guatemala City after the 1976 earthquake there that killed 22,000 people. In the aftermath of the quake, many thousands of people were either homeless or did not trust their homes to withstand aftershocks. Many of them dug temporary cave shelters in the sides of the hills nearby. Aftershocks collapsed most of these and buried their occupants. These were dirt structures, of course, and I would think that naturally occuring caves of rock would hold up much better. However, it would be a bad idea to intentionally enter a cave during an earthquake, assuming you could remain on your feet long enough to get there.
Although it was the deadliest earthquake in history. Anything anywhere would be a problem.
It was the deadliest earthquake in history specifically because of those caves. Had everybody been living in tents in a field, nobody would have died.
Except those weren’t “caves”, those were human-dug tunnels into dirt.
Where I grew up in Fairbanks AK we have similar loess soil. It has different properties than plain old dirt, it will hold together fairly well. You can carve it into shapes that will last for quite a while–there was a bluff near the University of AK that people had carved into faces and sandcastle type shapes. But despite being fairly sound, the stuff isn’t really strong. You can crumble it with your hands.
So those handmade loess tunnel houses in China were deathtraps. But as has been pointed out, if natural caves were likely to collapse during an earthquake, they’d have already done so, and there wouldn’t be a cave there any more. It isn’t so much that a cave would be a super-great place to be during an earthquake, but rather that it wouldn’t be the instant death trap that you might think.
Caves are a very safe place for earthquakes inside for the reason that they are completely unaffected. Earthquakes happen by the shift in plates, the energy of an earthquake breaks on the surface by rule of transference of momentum, the energy of the earthquake travels around the cave and breaks on the surface. This is why Black Chasm Cavern tour I led felt nothing in the cave to return to a shop in shambles. Cave entrance being covered from surface break would be the greatest threat.
Being underground does jack to protect you from quakes (or zombies).
I say this as a former geologist who has been at more than one site where bodies were being brought up after a quake-caused cave-in.
Let’s see:
I’m near the entrance of a natural cave rock (not a mine).
An earthquake starts - and keeps going.
Do I sit on the ground and enjoy the ride, or do I rush inside to see if another rock is dislodged?
This is a toughie…
Of course, the earth may split open and swallow me. Yeah. Right.