These villages better build defenses against the marauders or all is for naught. And of course, the best defense is a good offense. And... Fast forward to the presently peaceful times of mutually assured destruction!
That is a point of a village as opposed to living in separate farmsteads. (there are other points to villages, but putting a group of people together is an automatic form of defense)
Villages appear long before defensive fortifications in the record, in many cases. Pure reason is not very good at forming predictive theories about history, as a general rule.
There are many possible reasons for villages, and cultural reasons are a very big determinant of how people live. So are economic reasons. Many of us live in big cities now, and it's generally less safe.
Don't underestimate just how many people are needed to defend a village.
A village has a lot of land to defend and not many people to do it. The local town or city sized group will just pitch up with many more men and overrun you. All whilst having enough people left for defence. And they are likely to have more access to heavy weapons that can blow your house up from a distance.
Nations will overrun villages, but a city alone doesn't. Cities need villages to provide food, so a city never goes to war - it is instead the nation, headed by the city but also including all the villages.