I'm still getting to know the mechanics as well, but I think there are a couple of factors to take into account here.
The AI seems to choose its targets based on balance of power. If you look at the two-toned bar at the top of the screen when you engage with another party, this is how the game interprets the relative strengths of each of your armies. It's based on, at a minimum, both overall quality and quantity of your respective troops. You may notice that as your party grows, bandits go from chasing you, to ignoring you, to fleeing from you. This is because the game judges its ability to beat you in a simulation/autoresolve and plans accordingly.
So, villiger parties are solely made up of a varying number peasants, which are very weak from the AI's perspective. This means that any medium sized or greater bandit/looter party will always try to catch villager parties, and once they do they usually destroy them. The economy of a town is in part based on how successfully villagers can bring there goods to market by travelling back and forth. This directly impacts the quanity of trade goods a town has available in its trade menu (and how cheap they are). If villagers constantly die on the way, town prosperity will be low, food stores will be empty, and trade goods will be high priced. However, I don't know how great the impact is of any one villager party dying.
This is where villager bodyguards (donated troops) comes into play. If you stuff many troops into a villager party, bandits (and enemy lords) will be less likely to harass them, and they will successfully reach the town more often. Even low value recruits will act as a deterrent in great enough quantities. Foot soldiers will slow the party down, while cavalry will speed it up, so you must be careful not to let the villagers get too slow or they will be easy targets for large nobles' parties. Recruiting tier 1-2 troops is cheap and you will probably make your money back from the resulting increase in trade, but I can't say to what extent.
Now, town militias work in much the same way. Enemy lords look at a village's militia strength when choosing targets (as they have to fight militia before they can raid), so having a "garrison" in each of your villages makes it less likely to be raided and stay operational for longer. Once a village has been raided it has to build it's prosperity back up from zero after a cooldown, so it's advantageous not to let that happen.
It's hard to say where the line rests that makes buying and training new units not worth the benefit gained as a result, but if nothing else you can just discard unwanted units into these parties since they cost no wages. It's definitely worth investing something into it.