I guess the idea to really get across is presence. If you make it a problem that you are just existing somewhere by moving/swinging/shielding in a way that you avoid damage and annoy them, they have to dive or focus you. If they decide to do that you have a ton of damage mitigation if they don't dive all the way in with shield+health pool, and if they do go all in hammer and ult + teammates is an issue.
Like for instance a team with Reaper dives you, there's no point keeping shield up. Back up and swing, if anybody on your team deals damage or if you get a healer on you you can win the fight. If you get them to back off or you get a kill or two you can shield up to protect your team, or you can shield early when Reaper/Rein/some scary dude walks in that you think might ult. Gotta balance all that, shit's hard. Gotta know when it's most likely for them to throw something you need to shield.
If you just shield bot though there's like no reason to dive you. Just wait until shield is low/broken, then they push up and blah blah blah. You only wanna shield bot when there's just damage going both ways and nobody is extending the fight.
Also know Cooldowns. If Roadhog throws hook, you have a chance to drop shield for example. Then you have to decide if there's stuff worth dropping shield for (big firestrike, chance to dive, etc), or if Widow or some shit is still up you might not want to.