Every DM has their own perspective on this question: do you play the monsters to win?
In 5E? No, because D&D isn't a wargame, and 5E is particularly bad at being a wargame. It's asymmetrical and monster-wise, its poorly-balanced (albeit a masterpiece of balance compared to 3E, where CRs were
actively misleading).
4E was a weird exception here because it almost was a sort of skirmish game, and importantly, it was insanely better balanced than any other edition of D&D, and its CR-type system was wildly better at pegging what would happen. It's a bit weird because PCs were actually less balanced than 5E, but monsters were so much better balanced it more than made up for it. Also the heavy tactical nature of combat meant it was more fun in that case to play it more like a wargame in combat unless it was getting truly silly. Everyone got more out of it.
I try to play the monster according to its nature.
Yeah this instead.
This a ROLE-PLAYING game, again, not a wargame. My experience is that perhaps the majority of DMs forget this at times, and have monsters behave suicidally or just irrationally. Usually suicidally, and a lot of the suicidal behaviour is in the name of making encounters "tougher" or similar nonsense. Most humanoid monsters should not be fighting to the last unless they're cornered, for example. Most "predator"-type monsters should not be fighting to the last if they are fast runners or can fly or if the party backs off. But a lot of DMs just wanna get that extra bit of wear-down in, so insist these cowardly goblins or whatever will definitely keep fighting when literally 60% of their number got absolutely vapourized/blendered in round one of the combat.
To me that's shenanigans. Use insane fanatics or undead or whatever if you want monsters that fight to the death. Role-play the monsters and their tactics.
A Red Dragon might have layered defenses and centuries worth of combat experience to use against the party.
It might, but beings like are also arrogant, foolish (high mental stats never stopped
anyone being a fool) and importantly, it might not have faced any real serious challenges for decades or even centuries, and thus become lazy and lackadaisical in a very human way. Especially as Reds aren't exactly disciplined or hard-working.
A Red Dragon that's had people trying, quite hard, to kill it for say, 50+ years is going to be a nightmare. That absolutely will have layered defenses and attack in a careful controlled way with multiple exit strategies and so on. But one who has been unchallenged or even catered to for centuries may barely even remember what a real fight is.