When interacting with the player characters, your players must be left with a sense that they've met someone, or something, entirely different from the previous three, ten, or twenty non player characters. Players should be seeing the non player character and never the DM playing said NPC.
For a DM there comes a point during an rp session when things go bad, terribly bad - by this I mean within the game story/plotline. It could be a pointless defence of some long forgotten border keep where the party have camped and are now under a massive assault, but instead of cutting their losses and fleeing, they decide to make a stand ... or, due to the terrible group choices, the party as a whole face possible annihilation either by forces beyond their control, i.e. erupting lava flow, a cave-in whilst in a dungeon due to party stupidity, or just being total arses whilst in a town or other militia/watch controlled large settlement.
This is normally when the DM is placed in one of those 'you bastards', moments - that being the thought process of the DM. Why? Because any good DM should realise that to punish the player characters for said acts of idiocy, misguided bravery and/or blatant disregard for obvious dangers to life and limb will ruin the entire party dynamic, especially if these characters have been going for quite some time. To allow a player character to die at this juncture would mean a total disruption for the flow of the game, the morale of the other players (yes, it does happen), and quite often results in other party members suffering the same fate.
Should you, as a DM, have this happen, then I'm sorry to say but your carefully planned game will be a wash out. Close the book, and prepare to get everyone to re-roll new characters. A loss resulting in one player character is not good; losing two player characters is bad (especially if there are only two players to begin with). A 50% loss of player characters can be difficult, but not impossible, to recover from and regain the flow. It means a struggle for surviving player characters to escape, let alone complete the quest, and then a hasty return to the nearest settlement to heal, re-equip along with a fortuitous chance encounter with their 'new' party members - but I prefer to be less predictable in that area.
Now, don't misunderstand what I am saying, there are times when this can spur the remaining players on to doing something utterly brilliant in terms of role playing and quite literally, saving the day. But when out in the middle of endless wilderness, forest or the darkest depths of a long forgotten dungeon, I wouldn't hold my breath.
BUT ... enter the non player character/s. These, for the DM, are akin to the masked crusader, or the caped superhero, and some would even say the dreaded 'red shirt' crew member on Star Trek, for these (poor) NPCs are the rpg version of the 'Get out of Jail Free' card. It's a sad truth, but I have sacrificed many an non player character in order to save the group dynamic and keep the excitement and tension of an rp session going.
Cruel? Possibly. Optional? Yes.
Why 'cruel'? Believe this or not, but when an NPC is played well it has an impact on the players' perception towards this DM controlled non player character. It is not unusual for the players to take a liking to one or more NPCs others. If this is the case, then quietly congratulate yourself, as you have played your part flawlessly. It can be like money in the bank, so to speak.
Let's go back to how an NPC can save the day; in one word - sacrifice.
It is a gut-wrenching choice to make, but when you, as a DM, know the fatal outcome for a player character due to a party fubar (f***ed up beyond all recognition) moment, someone, namely the non player character, has to take one for the team.
- Punishment - by taking away one of their trusted number you clearly illustrate that there is no messing about in the planning and execution of their task/quest. Plus they are now in a slightly weaker and more vulnerable position, which tends to give them added focus.
- Morale - it is easier for the party to recover from the loss of an NPC than it is from the loss of a player character.
- Dramatic tension - like any book or film, rarely do the heroes succeed without a loss or two along the way, but the major players should be the ones victorious at the end ... usually.
- Mortality - it reminds the players that death touches their characters also an not just the mobs.
- Balancing - there are time when players become too dependant on the NPC/s, especially if they are used to soak up damage. Easy come, easy go attitudes should not be tolerated. Party non player characters should be valued by the players and not treated like a piece of equipment.
- Driving force - nothing like a bit of party grief to fuel the fires of revenge towards the one/s (perceived to be) responsible for their beloved NPCs demise.
I have witnessed some very touching moments resulting from the passing of a trusted and well-liked NPC. Being involved in every step of the way, quite often it impact upon you as a DM as much, if not more so, as it does the players.
So be prepared.
So be prepared.