Exactly. I hear a lot in online discussions how offense (the faster you kill the enemy) is always better. And that's simply not true unless you go back to max resources after every combat.
For example, if you've got a PC (25 HP, inflicts avg 5 hp per round*) against a monster (25 HP, inflicts 5 hp per round), assuming PC always goes first, what is the difference?
Better offense: +2 dmg per round for the PC
4 rounds to kill monster, suffers 15 points of damage himself (since monster dies on 4th attack)
Better defense: +2 dmg reduction per round for the PC
5 rounds to kill the monster, suffers 12 points of damage himself (since monster now inflicts 3 points instead of 5, and dies on 5th attack).
Basically, it's entirely situational, and offense is not always the best option. It can be, but it's flawed to say it always is. Even if the combat takes an extra round, the PC still has more resources at the end of it which will be important in further encounters.
*average end result that takes into account hit%, avg actual damage per attack, etc
Except that shields do not give 2 dmg reduction per round. To do that, 40% of the monster damage has to be negated which means that +2 AC has to relate to 40% of monster damage. The basic case where this happens is when the monster needs to roll a 17 to hit without the shield and a 19 to hit with the shield (note: this is not 50/50 since a critical does more damage than a normal hit, but it is not 40/60 either since criticals do not do double damage, more like 45/55, but close enough).
Even wimpy monsters have +4 to hit, so that would be AC 21 without the shield, AC 23 with the shield (very few PCs have this high of AC at 25 hit points). Since the monster is averaging 5 points of damage (i.e. the monster averages 5 points of damage with a 17 to hit (20% chance to hit), he actually does 25 points of damage per attack (not many creatures have 25 hit points and also do 25 points of average damage on a hit). So your example is really skewed damage-wise.
The more likely scenario is that +2 AC due to a shield actually stops about 1 average point of damage (40% of attacks hit instead of 50%), hence, the PC takes 4 damage times 4 rounds or 16 damage.
15 < 16. Offense still basically trumps defense. When we are talking +2 to AC or a 10% difference in outcome (i.e. only 1 attack in 10 do we get a different result), it is almost always better to be doing more damage.
On the other hand, not using a shield does not always result in 2 more average points of damage. It only comes close when effectively going from a D8 one handed weapon to a 2D6 two handed weapon (closer to 1.5 dpr, not 2.5 average total damage). In fact, Dueling vs. GWF results in about 1.8 more damage per successful hit or only .9 more damage per attack not using the shield (GWM is what really boosts damage for two handed).
You are correct. Offense is not always better. It is just often better unless fighting foes with a lot of attacks per round, or foes that take a lot of rounds to defeat. In those specific cases, defense can be better if the PC lucks out and gets into that 10% window of not getting hit with a shield multiple times.
And this is why controllers work so well. Even taking a few monsters out for a single round can shift combat quickly. Same for when a heavy damage dealer fighter type rolls great damage and takes out a foe. It shifts the action economy by subtracting one from the number of NPC attackers. Fighter types typically do large damage a lot more often than that 10% of the time that the shield prevented a PC from getting hit.
Obviously, every situation is unique, but offense does typically trump defense in 5E. Why? Because ending a battle in 4 rounds is typically better than ending it in 5 rounds (your example). With more time, there are more opportunities for the monsters to get lucky. The PCs win almost every time. The monsters only have to win once.
