Dungeon generation
Letting code build dungeons and level layouts instead of hand-designing them — the roguelike's signature trick since Rogue (1980).
Common approaches: BSP trees that carve the space into rooms and join them with corridors, cellular automata that ferment cave-like cavities out of noise, and the random walk (drunkard's walk). Grammar- and graph-based methods hand the designer more control — "lock and key" structures where solvability can be guaranteed.
The eternal trade-off is variety versus guarantees: pure randomness gives endless replayability but risks unsolvable or dull levels, while more rules give reliable but predictable results.