They do both.
Just having a shield worn does nothing.
If you use an action to "raise your shield" you gain the passive AC bonus
If you are a fighter or champion you have an ability called shield block that subtracts the shields hardness from the blow and then distributes the remaining damage to you and the shield itself.
Your shield can only handle a few solid hits like that before it is broken. A broken shield can't be used as a shield anymore but it can be repaired (easily done when the wizard is prepping spells in the morning or evening ). If the shield takes twice as much damage that it takes to be broken (really really hard hit) then it is destroyed and can't be repaired.
It is up to the fighter to decide if they want to risk loosing the shields passive bonus by letting the shield get damaged by a shield block.
Standard wooden shields are a bit weak, but good for people who can't shield block since they won't be taking damage,
Steel shields are tougher, then you can buy special shields called sturdy shields that are very expensive (min 100gp) but can take a heck of a beating.
Thank you.
It seems more analysis is needed before a definite conclusion is drawn.
I can't figure out exactly how many points of damage a Fighter can expect to negate by downgrading from Greatsword to Longsword...
...and I don't know if you can expect to simply haul out a new shield each time a new combat breaks out (and the old one got ruined).
I can only say that if a high-level character does four attacks, say, the damage differential you're giving up is at least 16 points, and do you would expect a corresponding +3 shield to negate maybe half that, or 8 points from every incoming attack.
On average! (If the shield can break mid-fight, it obviously must be rated at a higher DR)
Since high-level PF2 fighters very likely can increase DPS much higher than that, this 8 DR number is likely very very low.
Maybe magic shields add twice its "plus" in added DR, or something...?
If you expect the choice between shield and not shield is meant to remain an interesting one at these lofty heights, that is.
PS. Obviously magic shield can't break beyond repair like mundane shields in a game where magic swords never break, or we're back at Captain Obvious territory. [emoji854]