The power of these classes is conditional.
First, you have to realize that "cleric" is a hundred different varieties on a theme. Each cleric has a pool of spells that any cleric can cast, and then 2 other separate pools of often unique spells and the slots to cast them in the form of their domains. Each domain also comes with either a special ability or a skill bonus/availability.
Just at their simplest, a cleric is powerful because given 24 hours notice, he can come up with almost any magical effect. It might not be the perfect spell for the situation, but he will be able to come up with something that at least will help a little. If the situation falls within his domain, then he can handle it easily.
Depending on alignment, the "basic" spell pool also has the flexibility of spontaneous conversion of prepared spells in to either healing or inflicting spells, which can be used against undead.
The cleric also has a third pool of supernatural ability: turning/rebuking. At the basic level, this provides a method for handling undead. By taking optional feats you have a choice of greater access to domain spells, metamagic feat options, greater access to summon creature spells, or even better methods of handling undead.
Added to this is armor proficiency that does not interfere with spell casting, and proficiently with martial weapons. Even when out of spells and turning attempts, the cleric can still defend himself.
Now the conditional part:
A cleric "tricked out" for fighting undead is not going to be as useful in an "Against the Giants" game. He will still be useful, just not as useful.
If you put that same cleric into "Crypt of the vampire lord", then the rest of the party is along for the ride. I ran a level 10 female hafling cleric of Praylor with improved turning, sun and good domains, extra turning, disciple of the sun, Wis 18, Cha 20, and +2 staff of disruption. She kept shape stone, flamestrike, and detect magic preped. She, with the help of the party druid, detected, and negated every trap in the dungeon by using detect magic to find them, and then stoneshaping around or over them. If they found anything suspicious, they just covered it in stone. If they found a locked door, she stoneshaped the doorframe. The trick of the dungeon was that it was supposed to be one way with a trapped protacullus that locked them into the dungeon. Once this was defeated, the party was able to take the "meat grinder" dungeon in sections. On fights, she greater turning-ed all the undead into dust in round one, and flamestriked everything else. I made the character at the request of the gm to bring into a game so he could run an undead based module for the group, who didn't have a cleric at the time. We played half the dungeon, and then dropped the game never to return. The other players weren't having much fun, as the 2'9 39 lbs, female hafling was killing everything from 30+ ft away, leaving the fighters with little to do, while at the same doing the rogue's job. We figured that she would destory the vampire in surprize round, so there was no challenge,.... no fun...., in the module.
And I wasn't even trying hard to power game. If I had made her human, with the extra feat, she would have been worse! (better)