The first dungeons were crafted by midwesterners with too much free time. They got it right the first time and the only improvements to be made are quality-of-life upgrades. The following table is my current personal dungeon stocking table. Traps are bullshit what tries to kill you. Tricks are interesting things that don't try to kill you and in fact are fun to mess with. The math here is "inspired" by OD&D.
|#||Monsters and Treasure||Tricks and Traps|
|2||Monster guarding treasure||Unhidden trap|
|3||Unguarded treasure||Hidden trap|
|4||Hidden treasure||Hidden trick|
To use this table, roll once on each column per room. It is balanced for d12s, but you can get denser or sparser dungeons by using other dice. For extra dense dungeons roll multiple dice for a column. Make sure you know which die goes to which column for better randomness. If the number isn't on the table then there's no treasure/monster/trap/trick. That doesn't mean it's a boring room. An "empty" room might have clutter, interesting runes in the walls, a painted mural, etc.
We use randomness to offload some brainpower to the dice spirits (blessed be their polyhedral names), and to make them less predictable. Human minds fall into patterns without realizing it. Dice only fall into patterns when they mean to. But you should always use your human discretion and not make an unfun dungeon just because the dice told you to. It's a collaborative process.