Don't think of a country as an area of land. Think of a country as a club, to which a group of people belong. Nomadic tribes were not attached to any particular area of land. Settled agriculture on scarce land is a recent and contingent fact.
Clubs provide club goods to their members. Club goods are (at least partly) non-rival and (at least partly) excludable. Mutual defence is the most obvious club good that countries provide their members, but they often provide others too.
Membership of a club brings with it both rights and obligations. Membership of a club is itself a good. It's an asset that provides a future flow of benefits (and costs). Membership of a successful club, that non-members want to join, is a very valuable good. Should that very valuable good be priced at zero?
Open borders is not about free trade in land or labour. It's not about physical geography. Open borders is a proposal that membership of a club be a non-excludable good, and must therefore be priced at zero. Anyone can become a member of any club, without the club being required to give its consent. Countries may not charge non-members a one-time enrolment fee (or cherry-pick applicants) to become a member. Anyone who applies for membership must be granted membership, and pay exactly the same annual schedule of dues (taxes) as existing members to benefit from using the club goods.
Making club membership a non-excludable good may create problems. Just like making any valuable good a non-excludable good may create problems.
For example: suppose a club were deciding whether to undertake a risky investment, and how to finance that investment.
With closed borders, where the club has the right to demand a one-time entry fee for new members, the club could use equity-finance. Existing members of the club pay higher dues to finance that investment. They buy newly-issued shares in that investment. If the investment is successful, new members cannot join the club and benefit from that investment without paying extra. They don't get the equity for free.
With open borders that won't work. The club would have to use debt-finance, so that both old and new members would pay equally the full costs of the investment. Borrow the money, and add the interest to the annual membership dues (taxes).
But 100% debt-finance does not work for risky investments. (And investment in mutual defence is risky; you might win or lose the war.)
Suppose the UN announces that, starting next year, open borders will be the rule. Canada is a wealthier country than most. Many people would want to join the Canadian club. If the UN made that announcement, I would recommend an immediate major change to Canadian fiscal policy. I would recommend an immediate large increase in the Canadian debt/GDP ratio, used to finance an equally large one-time lump-sum transfer payment to existing Canadian citizens (helicopter bonds). That would be a good way to get around the future UN prohibition of restricting membership (charging an entry fee) to the club. Existing club members (and their heirs) would be paying interest to themselves; but new club members would be paying interest without having benefited from the helicopter bonds. It's a way to charge new members an under-the-table initiation fee.
Stuff like that happens, when you have price controls.
I was trying to do a back-of-the-envelope calculation of how high a debt/GDP ratio would be needed for wealthy countries to get around the UN prohibition, and charge a market price for membership in their clubs. Distortionary taxation, and multiple countries, make it tricky to do that calculation. But if we assume one small rich country, that has a per capita income 10 times bigger than the rest of the world, and lump-sum taxes, and 5% interest, I reckon a debt/GDP ratio of around 1,800% should be enough to equalise after-tax incomes. Sounds about right.
Sometimes I hate economics. This is one of those times. (Driverless cars is another.)