Dirt that is deep underground is like a sponge that is soaked through with water which keeps it stable, and if the water is missing then it leaves behind air pockets which cannot support the weight of the dirt and buildings above it. Additionally, standing water from rain adds to the surface weight. In other words, when one is dealing with dirt that lacks groundwater then one should tip-toe as if walking on egg shells.
Just as ground water saturates dirt and supports the weight above it, so does oil underground, which is one reason why fracking for oil underneath people's houses is a really bad idea.
Homeowners in northern and central California can ask Pacific Gas and Electric ("PG&E") what kind of ground their home was built on top of. The field technicians who dig in the ground know what's underneath every neighborhood. For example, in San Francisco, when they are sent to dig on Potrero Hill they know that they'll be dealing with solid bedrock, when they go to the Outer Richmond and Outer Sunset district they'll be dealing with sand, and in the Marina it's landfill. Every neighborhood is different.
An urban sink hole
This is a sink hole in the middle of a busy intersection. It's as if the car drove into a swimming pool. In this case, it appears that the dirt underground was so dry that it was about to collapse, and when the neighborhood had heavy rain it added a lot of surface weight on top of it which was the impetus for the collapse.
A house built on top of sponges
The soil below is like a sponge that is saturated with water, and when the water is missing then the dirt sags and under certain conditions it could collapse and leave behind a sink hole.
The soil had been paved over and so the locals couldn't see it, but if they had then this is what it would have looked like before the collapse.
Standing water adds to the surface weight
Before one jumps for joy over heavy rain because we need it, consider that it could turn into standing bodies of water which add weight to the surface, which is supported by whatever is underneath.