It's All in the Roleplay
I don't mean this in the sense of character acting, but in projecting yourself into the mindset of your NPCs and making decisions for them. What do they want, how far are they willing to go, what skills can they throw at a problem, etc. Answering these questions will help you immensely in designing and running more realistic encounters. If you know a lot of your NPCs will try to run away, you'll probably need to familiarize yourself with the chase rules (or make a system to adjudicate chases, as the default system is lacking in choices for your players to make).
In my experience, it is very difficult to run an entire campaign where all enemies are inexperienced cowards who will cut and run at the first sign of trouble. It's hard to feel heroic when the only ones you fight could probably have been taken out by a few of bored teenagers. This is particularly true after level 4, when your power level enables you to be of real use to kings and governors. You need to vary the tenseness and the pacing of your fights by also including more professional enemies, either as supplements to the usual cannon fodder or as the occasional brute squad who came to see where the boss' lackeys got to.
Soldiers vs Joe Farmer
One thing that comes to mind when reading your question is that the attitude you describe will most likely be found in those who do not have formal combat training. Part of the reason soldiers train is so that when everything hits the fan, they have effective preconditioned responses to fall back on. Another difference between soldiers and farmers is that soldiers have made an implicit promise to follow orders in pursuit of a goal. Even if following orders might result in death, they will follow those orders to give their comrades a chance to complete the objective; the farmer may not have such a promise, but depending on his motive for starting the fight, he may still be willing to go through with a fight to make sure his community gets money for food, etc. The third difference is that soldiers are implicitly part of a unit, and they will take risks to protect each other; a group of farmers may or may not have any such cohesion, and as such will be more than will to cut and run or betray their fellows. Another thing to consider is the temperament of the enemy they fight. Soldiers are unlikely to break ranks, knowing that doing so no only compromises the mission, but may also cause more casualties than would be given if they simply kept at it. Farmers probably lack this discipline; they might cut and run if they think the foe will overpower them, they might try to surrender and bargain for mercy, or they might throw their "friends" under the bus.
What's my motivation?
The first thing you should ask when designing any encounter is what the motives of all NPCs are, how are they likely to accomplish those goals given their temperament and capabilities, and what are they willing to risk. Are there any ways that they might accomplish those goals without resorting to a mutual murder extravaganza? It might not hurt to just ask nicely first. How will they react when something they're not willing to risk is threatened? Do they surrender and beg, cut and run, or fight even harder? If a fight does break out and things go south, what escape routes are available?
Dirty Rotten Trickery
In the real world, there is no such thing as a fair fight. The underdogs are going to need an Ace in the Hole, and they're going to use any tactics they can to push the odds in their favor. Doing it right can lead to very interesting situations (see Tucker's Kobolds). Outnumbered? Use surprise hit and run attacks. Know the route your enemy is going to take? Stage an ambush. See that big rock over there? Attack from the top of it so your enemy can't get to you easily. Roll barrels down the street, swing logs on ropes through the middle of them, set the hay under their feet on fire, have Fred grapple the wizard so he can't cast using somatic components while Igor makes a few holes in his belly; just be disruptive and smart.
What are Your Player's Goals
If you're tasked with cleaning out a nest of small, weak monsters, you're probably not going to think too much about an enemies efforts to run or surrender; you will have completed your task. On the other hand, if your job is to quell tensions in a city devastated by famine, there are very real human consequences to breaking out the murder stick. You need to think about ways your players might try to defuse and work with their would-be enemies.
Example - Goblins: The Consumate Cowards
In the default lore, goblins are opportunists and cowards. They pick fights with those they know are weaker than they are, and they often strike from ambush. When overpowered, they won't hesitate to surrender and show the PCs in the back door to save their own hide. However, they're also clever. That goblin you captured? He's lying through his teeth and you're about to walk into the main force. Those goblins you have on the run? Watch out for pit traps. And for goodness sake, when you trip over a vine, throw yourselves sideways onto the ground and pray that poisoned dart misses you.