Pointless answer. Too generic, too easy.The rules serve the DM, not the other way around. The rules cannot require anything of the DM.
In the situation I painted (the dragon being extremely lucky on his rolls), it is not a rule of the game requiring the DM to roll, it is logic.
If the DM doesn't roll for the dragon attacks, the players will ask "why is the dragon just staring motionless at me? Is he dumb?"
The players will slay the dragon but will know that the DM helped them.
Something like this is worst than fudging dices.
1- the DM broke a rule anyway, he did not played the dragon as he should have done, as a creature with high intelligence.
2- the help coming from the DM was clearly apparent to the players, and now they will feel safe. But safety takes the thrill away.
Far better roll for the dragon and fudge his fourth 20 in a row into a miss.
TPK avoided, players unaware of DM's intercession, everybody is happy.
What you don't know cannot harm you.
That means that your players will NEVER feel the thrill.I don't really care if character deaths or TPKs happen, but if I did, then I would change the goals and stakes of challenges so that they do not include the possibility of character death.
Avoid at all the chances of character death means that by knowing the character AC, you choose for him only opponents unable to hit him. This is the meaning of "do not include the possibility of".
I guess you understand this is not that good.