Often dm's accidently teach players that they don't need to/shouldn't run away. Every time you do the whole "nobody has ever made it out of those caves alive" or a fearful NPC shouts "we need to run away!" and the players push through and succeed anyway you're kinda teaching players that fighting through it is the solution to impossible problems.
If you want players to think running away is an option, you should teach them. Make escaping feel like a win for the players. Consider setting up scenarios where they need to steal something from an ancient dragon's hoard and get out with it alive. Or after the players have gotten whatever they need from a dungeon and they're low heath have a huge strong enemy appear near a passage that the enemy is much too big to fit through.
Blaa in south east of Ireland