Every 72 hours, there is a 3% chance for a village to become infested by bandits. During this time, you may happen upon the infestation by entering the village, or discover a farmer in a nearby tavern asking for help. This quest may also be initiated by successfully training a peasant militia to defend themselves.
The village will be saved simply by wiping out all bandits. Their numbers will equal
(your character level + 10) * 1.2
The villagers will also come to your aid, though they offer very little actual help. The number of farmers that spawn is random, between 25-29.
Once the infestation has been defeated, the villagers will offer you a reward which you can accept as just payment, or refuse on grounds that they "need it more than you" which will double the relation bonus. Note that if the village is exceptionally poor, such as having been very recently looted, there may not be anything available even if you choose to take the payment, effectively halving the relation you would have otherwise received.
Should you fail to triumph over the bandits, they will pillage the town in retaliation. Despite your efforts to help, you will also receive a small negative relation bonus with the village.
Ignoring bandit infestations will result in a loss of -1 prosperity for that village.