I agree strongly with LitheOhmLitheOhm, but to add a couple of things on:
Make sure they understand fleeing is actually an option. If you are facing an opponent that really wants to kill you and is faster than you or has good ranged attacks, you might be best off staying and fighting even if they are much more powerful. Then you have a (slim) chance and at least you'll die on your feet with a weapon in your hand. So, if you want them to flee they need to know that either:
- The enemy doesn't actually care about them and will leave them alone if they retreat (or distracted, etc)
- The enemy is much slower and has limited ranged options.
- The players have some effective deception techniques (illusion spells, smoke bombs, etc.) that will actually work on this enemy.
You can also reward appropriate retreating beyond survival. Appropriate retreating is a correct role playing choice and could be rewarded with XP and other adventurers agreeing they did the right thing.
They could also see more conventional gaurdsmen and militaries being praised for proper strategic retreat that enabled a later major victory.