Everything is voluntary, think of them like big HOA/condo communities, many will have different customs and rules, private security, private courts
Then multiple communities can pool resources to hire private military contractors to defend against other nation-states who aren't practicing anarchy, and if they do a bad job you can fire them and hire another contractor in a free market
It's similar to having a government, but you can fire them, which is an important distinction
I suppose the problem arrives when you get people from other countries who like the ideas of one of your cities and that city wants to welcome them openly, but other cities don't want those cities growing too fast.
Then you're back to square one :)