CR 20 dragon vs. 5th level party. Unless you're an incompetant DM, that's sure TPK no matter what the party does. They can't even run between flight, teleports, dragonfear, breath weapons and spells. Of course, if the situation does come up, it certainly calls your competency into question in the first place.
Tough but fair should be the DM's motto. Ok, if that CR 20 dragon is coming it better darn well NOT be a combat encounter. The ability to kill an entire party is not the measture of a DM's worth, since every DM has the power to squash the PCs flat. All you have to do is sit at the head of the table and say "you're all dead, thanks for coming" and that's it. If you're feeling generous, you can have the local God of Death suddenly appear and kill the entire party with the Mass Life and Death Salient Divine Ability.
Adversarial DMs are about as fun to play with as a dentist's appointment, they're even less fun than DMs who let the players get away with blue murder. Edena brings up some excellent examples, all of these are sure-fire methods of pissing off your players.
I'm not saying you should never kill a PC, far from it. I average about 1 a session. But there has to be a chance, even if it is a slim one, of the PCs pulling victory out of nothing. This is where the skill is in being a DM, walking that fine line between being harsh but giving the players a shot. A dose of fairness and realism, in fact.
It's not realistic that every monster in a dungeon will come running the moment the PCs engage in combat. Even if a high level mage throws a spell, there's a save mechanic that gives them a chance of avoiding it. TPKs are, simply, boring. The players all have to roll up new characters, which is alot more boring than playing the game. Facing the daunting task of starting all over from scratch, they might even just pack it in altogether. And I don't blame them, it's not like real life where you have to suck it in and deal, it's just a game. It's a want rather than a need.
Never forget that, at it's base, the sheer unadulterated fun of blasting and chopping a whole bunch of nasty things that want to kill you is a major part of the DnD game. Players love encounters where they face a horde of kobalds and slaughter all 250 of them. It's fun in a similar vein to the first person shooter. And they have so much fun they fail to realize that you're just fattening them for the apocalypse to come.
And when the apocalypse does come, they'll stand and face it, live or die, because they know they'll have a chance and they'll feel like real heroes. That's far, far, more fun than being slaughtered in an inconsiquental random encounter stilted so far against them that they haven't a hope in hell. The players will dispair and they will get angry because in the end, the DM has cheated them of their fun.
The adversarial DM, in his ego, is his own worst enemy as players get more hacked off, the group will tear itself apart. At best, the DM will be alienated with no fault but his own. DnD, as a group activity (or any rpg), has to cater to the needs of everyone at the table and the DM, as the arbitrator, has the unenviable job of fulfilling those needs.