A D&D megadungeon should be a living, constantly changing place. I want my players to have the impression that the dungeon is full of other creatures with their own active agency. Of course, it is all an illusion, and the referee's job is to stage manage this illusion to give it enough verisimilitude to create the desired effect.
The "Hack and Slash" blog discussed dungeon restocking yesterday. Here's how I do it.
In my notes for my megadungeon, some of the keyed encounters certainly represent permanent monster lairs (until defeated by the players), but many more of them represent snapshots in time. I have room descriptions like, "Bedroom. Seven gnomes are currently taking a break here from their explorations away from the mines." If the players encounter the gnomes and then come back later, the gnomes won't be there anymore - they've gone back to their work in the mines or were eaten by giant shrews or whatever. And likewise, rooms that were empty the first time might now have other creatures wandering through.
I use a method that I first read about on Grognardia that was originated (as far as I know) by Dave "Sham" Bowman in this post. I more recently saw the same table used in Michael Curtis's wonderful Stonehell Dungeon.
2: Monster with treasure
3-6: Empty (no change), 1 in 6 chance of unguarded treasure
After each session, I simply go through every room that the players passed through and roll on this table (except for rooms where they left a lair of creatures alone). If a monster is indicated, I roll on my custom wandering monster table for the level or subregion.
This came directly into play in the last session. After the first session, I restocked the rooms the players had passed through. For one of the empty rooms, I rolled "monster with treasure" and the wandering monster table indicated seven bandits. Rolling randomly for the bandits' treasure, they were found to be carrying two pieces of jewelry worth 1,500 and 500 gold pieces.
The players were lucky enough to choose to retrace their steps (they wanted to go take care of the giant rats they had seen on their first trip), and they defeated these bandits and claimed the treasure. That's 2,000 experience points for the party that did not exist in the dungeon until I restocked it. I really enjoy what restocking does for the feel of the game. The dungeon feels like a changing, fluid place, with other monsters and groups moving through it all the time. As you can read in the game report, the encounter with the bandits took the game session in all sorts of interesting directions, and opened up new avenues for the players in future games. And all because of a few random dice rolls!