This feels more like a world-building question than something specific to halflings.
My assumption is that a bog-standard D&D setting is generally assumed to look like a late medieval Europe, with feudal castles and manors being surrounded by cleared woodlands that support a spread of farms, with small villages dotting the countryside serving as a central point for the farms that are close by.
I think this idea sits in tension with the the idea that there are high challenge threats every few miles that are capable of killing dozens of peasants (of any race) whenever they get hungry or bored.
When I run games, I tend to present settled, civilized areas (where I assume most pastoral halflings are present) as not having a lot of challenging threats. Some stray bandits, occasionally a CR 2-3 creature living in the woods or nearby hills, but generally things that can be handled by low level adventurers. Roving bands of orcs or gnolls are a significant emergency requiring the marshaling of the troops of the local lord, not something that occurs every autumn that the mayor of the village is expected to handle.
If you're running a game where significant challenge threats are being encountered as destroying local villages as a matter of course, I think it would be important to present that as a dynamic situation implying major changes to the political structure of the area, not as something that's part of the general equilibrium of the area. That would only make sense in a frontier or border march area where desperate people settle with a general understanding that there's significant risk.
I think the question is...
If area faces a warband once or twice a generation, would the area put resources into having a major defense force?
Basically if "ORC TRIBE ATTACKS" happens every 30-40 years compared to the human 15-20 years, does halflings not having any strong military answer readily available make sense?