Many games, mostly strategy, utilize the military movement known as a retreat. In simple RTS games, the enemy AI, after losing several units, may return their army back to their base in order to regroup and save their losses. Retreating is featured as a plot point for more action oriented games.
In the Total War series, units on the battle map can be ordered to retreat if the battle seems hopeless. If the unit sustains too much stress or casualties the men will break and rout, which can spread to other units. The General can rally the men, unless they have the shattered status, in which case they will never return to fight.
In the Company of Hero series, the retreat function allows a squad to run back an allied HQ with no interruptions. While in retreat mode most units receive less damage from enemy units and run at a faster pace.
For Deus Ex, an NPC, after their health has dropped below a certain point, would disengage from fighting the player and run away. At this point they would never fight back, but would still trigger alarms or alert others if the player character returns.
The combat system of Assassin's Creed also included AI's getting scared off. If the player killed enough of their comrades, the inexperienced and lightly armored enemies would run off in fear.
In Metal Gear Solid 4, Kojima productions worked with psychologists to create realistic responses from enemy AI. One such response was fear, where enemy soldiers when witnessing mass carnage would get scared off. If the player wears the Big Boss mask, enemy units would freak out and leave.