Specifically, the following creatures are listed as being impressive: dragon, giant, giant spider and mammoth. Furthermore, these NPCs will flee when attacked by an "impressive" aggressor, even if the NPC is a higher level.
For example, an NPC wearing a cloth outfit will flee once his health goes under 50%, while an NPC wearing full heavy armor and a shield will only flee once his health dips below 25%. These thresholds are assigned according to the NPC's resistance to physical damages. At the moment, there are four percentage thresholds: 50, 40, 30 and 25.
The hideout is chosen randomly, and the number of hideouts NPCs can access depends on the size of the city in which they live. In short, if an NPC is attacked and has no chance of winning against an aggressor, that NPC will run away from the aggressor and attempt to find a safe place (a hideout). Survival Instinct is a feature which gives nearly all the friendly and unique NPCs of Skyrim the ability to properly evaluate danger from an aggressor and respond to it more realistically while under attack.
Specifically, this mod adds a new "Survival Instinct" feature to the NPC AI. This plugin greatly improves the root AI used by NPCs when they are in combat.