Before I started my campaign I warned the players that it would be difficult in the extreme, and so to be prepared to act intelligently against similarly intelligent opponents. There have been a few times when the party was just about dead or near-TPK (though one of the wizards (necromancer really) almost never dies, since he tends to relegate himself to the back of any fight, preferring to send in his familiar replacement and cast spells) and they managed to turn it around, just. Other encounters have seemed too easy to me, but may have been challenging to the players (I put them up against an ogre-mage, and it surprised them and nearly killed the necro, but the players dispatched it shortly thereafter (though that was partially because I ignored its regen completely), so I figured it was slightly too little a challenge, but they seemed pretty happy/excited about that session). The PCs all have unusual stats (extraordinarily high) so I tend to throw slightly harder than their CR encounters at them. No one has died yet, but when they do, resurrection magics will be readily available, but not necessarily an *easy* time for the deceased.
I have no problem with fudging things in the players' favor when certain factors serve to throw the wrench at them, though. Sometimes I'll plan too hard an encounter, or ORPG will roll a string of below average rolls for the PCs and mostly crits for my NPCs etc. I tend to fudge in favor of the PCs pretty heavily in these cases, since the players have a lot of investment in these characters specifically. That said, if they meet an even encounter and nothing strange goes down and they die anyway, it will either be resurrection quest or new PC rolling time(probably the former, given the difficulty of introducing a new PC to this particular group*).
* - The group of PCs is almost entirely evil in this game, or borderline evil. They've made a huge amount of enemies, so tend to distrust other characters in general. The current group is cohesive enough due to long adventuring time between the characters (about a year in game, and it's been about two years out of game) that I'd rather not introduce a new one if one of them died.