Drunkard's walk
A level-carving method where a random-walking "digger" tunnels floor out of solid rock until enough is open — the lazy route to an organic, always-connected cave.
Fill a grid with wall, drop in a digger, let it step in a random direction and carve out each cell it passes. When a set fraction of the map is open, you stop. Because the digger always moves from already-open ground, the result is guaranteed connected — no isolated pockets — and looks naturally cave-like, without the straight walls that room-and-corridor methods produce.
The method is a roguelike classic precisely because it is a few lines of code and still never produces an unplayable map. Several diggers, or a bias in the direction, shape the cave's character.