D&D is an RPG... a role playing game. The characters play a role in a story. Make it a good story.
If I am dropping Fire Giants in front of the PCs when they can't handle them, there is a reason. If there is a reason, I'll set it up. While I set it up I will include warning signs of the incredible difficulty. For example, if the PCs just spent a few rounds cutting down a beater monster that had a good amount of HPs, I might have the PCs observe the giants take down a similar monster real fast.
However, there are few reasons for me to put a foe into the game that will be likely to overwhelm the PCs in a fight. They're the heroes. Making them feel insiginificant on a regular basis doesn't make them feel like heroes. It makes them feel like they're being bullied.
Then, if Ido set it up, regardless of what the PCs decide to do, I am looking to make it a great story. It might be the great ending... it might be a horrid learning moment where allies are lost... but if I felt a need to put it in the game, there is astory to be told.
I think this illustrates a difference in play style. To many (such as myself), the PCs do NOT play a role in the story. Not in the way you describe it anyway. You seem to have the story as coming first, then PCs reactions later. For many such as myself, the PCs play a role in the
game world. The difference being that the story comes later, based on the PCs actions. They craft the story as they go, and based on what they do. And sometimes, the story doesn't have a happy ending if their choices lead to that. The fire giants could be there for no other reason than they live there in the world, and have nothing to do with any predetermined story. I don't need or want to come up with a reason beforehand of them being there being tied to the campaign story. Ecology, living game world come first.
Some of the best stories playing D&D were created by the players via their PC actions, and not based on a pre-determined story me as the DM was telling, so it's not really wholly on the DM to make it a good story, as you say.
Needless to say, I also disagree with your opinion about rarely putting a foe that will overwhelm the PCs into the game. As you say, they are heroes. Nothing heroic about always knowing you will win. In fact, it kind of runs counter to the whole heroic journey thing. You don't want the PCs to feel bullied, well, I don't think turning the PCs
into bullies is any more heroic.
But again, all of this comes down to preference and playstyle I'm assuming.