Yeah that's on of the things that get hand-wavity when you bring up these city-state type plans as well as anarcho-whatevers. They generally wouldn't be big enough to defend themselves from religious extremists or nation states acting against them--many of them not even figuring in defense against other entities and saying "we're pacifists". That kind of stuff only works when external factors like aggressive neighbors don't figure in.
Most models include various types of People's Militia. YPJ is the military of Rojava. Interestingly, it's a military without a hierarchy, just individual teams with some basic coordination.
Yet with this they were able to beat ISIS when others had failed.
I mean, if you're going to make that kind of political argument you can claim that Western Europe's postwar prosperity and relatively strong welfare states are a by-product of America footing the bill for defense (plus the seed investment of the Marshall Plan).