Hear me out for a second.
If I said that there was a human militia with chain mail and pikes guarding a town, would people tell me that that goes completely against human nature? Would people tell me that according to the books, human knights and court mages simply aren't assumed? If I said that the human sheriff of a town was the veteran of the King's army, would it seem strange to you?
But what about halflings?
And armored contigent of halflings as a militia seems entirely bizarre to people. Enough that claiming one should exist got be accused of wanting to make DnD Grimdark and not worth living in. Halflings don't have knights. They don't have court mages. If I told you that you were in a Shire, full of halflings, and I said that the sheriff was the veteran of the King's Army, you know what would be the first question I would expect? What King? Because he has to be a veteran for an army that was led by a human, an elf, or a dwarf.
That is a pretty major difference. If I said a human town was walled, people wouldn't be accusing me of anything. The armed guards welcoming you at the gates to the town is a well-worn trope. It fits... but it doesn't fit halflings. For whatever reason, people don't want them to have defenses, guards, soldiers, any of it.
Yes, those human towns should have walls. They should have something like a sea wall too, to defend against the oceanic threats, but the oceans are big enough and contested enough I can buy there isn't a huge budget for defense in that direction that overrides the need for sailing vessels. But even if they don't at least it is not against their lore and image to have armed guards ready to defend the people.
Would Halflings use the exact same tactics as humans? No. But I don't have a problem with this image
or even
But we're not talking about armies made up of halflings. Halflings don't have kingdoms, they have villages. Most are probably embedded in other race's kingdoms. That doesn't mean they don't have defenders against raiding parties.
But you still haven't addressed my question. How do most small villages and farming communities of any race survive? They aren't going to have a large enough contingent of heavy infantry to defend themselves, they couldn't afford it.