Gary had a habit of summing up gaming experiences into pithy little sayings. One of my favorites was his oft-repeated admonition that while he never set out to TPK (total party kill) if players insisted on running into the outstretched sword he'd certainly allow them to do so. I feel much the same way. Brought on, I suppose, by my wargame experiences in which losses were commonly the result of poor strategy or tactics.
Sometimes, however, the dice just hate you and want to kill you. As referee I've made a habit of rolling in the open so the player can see the dice fall where they may. This is why one uses dice to begin with, after all, to introduce an element of chance (or chaos to my way of thinking!) into the game. So, what do you do when the players do everything right but the player-characters wind up in extremis?
INSTA-CAPTURE! I've mentioned this in a previous post but one house-rule Gygax used and is rarely mentioned elsewhere is the insta-capture (my name, not his). This ruling states a PC successfully grappled by four opponents of a similar size is instantly and automatically successfully overborne and subdued. Thus, if half the party is slain or hors de combat there is no need for a bloodbath. Thag the Orc-King (first of his name, don't you know?) orders Sergeant Grom and his squad of 40 bully-boy Orcs to take the player-characters into custody. Hooting and jeering the Orcs swarm over the adventurers still on their feet and the lot of them are carried off and thrown into the Orc's prison cells. Those smooth-skins will pay, and pay dearly, to get their precious heroes back. The PC's, on the other hand, will have to pay back every gold piece ... with interest! If they don't have the money? Or if the money is in some big city bank? Well, no credit here! This is why spells such as geas and quest exist!
Or maybe 1 or 2 player-characters escape. Upon returning to town (or home base) with nothing but what they managed to carry as they ran away from the fight, they'll have to organize a rescue. This will cause them to lose much face with the locals, you can be sure of that! The one(s) that escaped may be accused of working with the enemy, or of cowardice.
Or perhaps one of the captured player-characters is sent by the Orcs to carry their own ransom demands back to the town. That one is under threat to return within "x" days or one of his fellow adventurers will be beheaded each day of his delay. Of course, upon returning to town the carrier of the ransom demands is thrown into jail while the Captain of the Guard sorts out what happened ...
BOTTOM LINE There is no need to wipe out a party if they've had a run of bad luck. Now, if they are goofing off and playing poorly, by all means: let the last thing their characters see is the edge of an Orcish scimitar. The insta-capture rule can allow the referee to show a bit of mercy to otherwise good players without flat-out rescuing them by deus ex machina. They players will pay for their bad luck, such is life, but they'll live to fight another day. Of course, Bambi the buxom tavern wench will never look at Boromir the Brave with the same twinkle in her eye again.