Government is a hard topic to discuss. They do so much it's incomprehensible and most of us have never gone without a government so it's not clear what their core function is. Let's take some advice from Papa Elon and see where it takes us.
Think of the government essentially as a corporation in the limit - Elon Musk
Government is in an industry with a very strong tendency to be monopolized. This is because, for them, violence is an option. And a competition of violence can only happen once with the winner taking all.
Despite this some interesting thoughts come to mind when considering governments as corporations:
Governments and companies have evolved similar bureaucratic structures:
CEO -> Prime minister
CEX -> Minister of X
Parliament -> Board of directors
Citizens -> Voting shareholders/customers
National currency might correlate to shares in a company. When a country increases exports or grows it's population it's dollar becomes more valuable as when a company increases profits it's shares become more valuable. But when a country splits it's shares by various means generally known as printing money they don't distribute the new dollars according to proportions currently held like a company would. Hence countries are a poor form of company to invest in. Dollars should be used to pay your taxes and as little else as possible.
Land as shares in a government. Since most economic activity relies on land the value of land is pretty well correlated with the economic output of a country. But again countries don't distribute wealth fairly when they rezone land or reclaim it from the ocean. Hence, land, like dollars is an imperfect substitute for shares.
You might think there is a glaring difference between companies and governments in that companies deliver a product or service while governments do not. But as Elon goes on to say, "the purpose of governments is to act as a referee". i.e. Governments are a service provider and that service is cooperation. They enable extremely large groups of people to work together productively. Without governments humans are restricted to tribal sized units of cooperation. Governments should be measured by the size of the in group they create and the amount of infighting within that group that they prevent. The larger the group the more opportunity for specialization and the more trust between members of the group the less resources are wasted on conflict. Both result in more production per person.
But there is one key difference between governments and companies. Competition. The vital spirit of all companies. No company can survive long without it despite their belief to the contrary which causes them to pathologically pursue monopoly. If they were to ever actually achieve monopoly though they would quickly grow fat, lazy, and obsolete. Hence, a wise company will seek competition rather than avoid it.
Historically, competition between governments has led to war since high transport costs have kept trade relatively low between countries. This means that competing countries are often worth more as parts than partners. But it's a economic calculation that determines this and over time it's coefficients have changed and the probability of war has reduced as a result. So let's analyze these coefficients and see if we can improve outcomes further still.
The probability of war between nation $a$ and nation $b$ is given by $P(a, b) = \frac{\mathrm{war\ cost_{a}}}{\mathrm{trade\ benefit_b}}$ To reduce the chance of war you need to either increase the cost of war or the benefits of trade. And at any given time the probability of war breaking out with any other country is given by:
Let's take a look at each of these components in isolation.
Diplomatic repercussions. This will primarily be loss of trade with other countries who impose trade restrictions in retaliation
Marginal cost of military spending
Loss of life which incurs both a compensation cost and lost production
Transport costs. As transport costs go down the benefits of trade go up
Access to factors of production
Access to land: Land is often a prerequisite for any business and since most countries severely restrict access to it it can often be a major cost or barrier to deploying capital. Many countries even take pride in how expensive their land is as if it's a good thing. And Australia makes industrial land significantly harder to finance than residential land. Safe to say most governments underrate the importance of land as a factor of production.
Access to capital: Primarily this will be determined by the quality of the countries' legal system since the legal system generally deals with problems that occur during the coarse of loans, it's effectiveness determines the cost and availability of loans.
Specialization. This is a recursively defined parameter since as trade increases it causes an increase in specialization which improves efficiency and lowers cost which in turn produces more trade. It can almost be substituted for time since when other parameters of trade are improved specialization will also improve over time. However, specialization can be improved independently of other parameters through education and culture so it's not entirely interchangeable with time.
Transport cost is coming down.

Air shipping cost has come down dramatically while ocean shipping cost has halved at the ship chartering level. This hasn't translated into lower ocean freight costs for manufactured goods because port charges have increased and perhaps line companies have colluded to keep prices up. The cost of containerized shipping has stagnated since it's introduction.


However, blimps are being developed to serve a niche between air and sea freight. They might make it easier to transport containers to centralized hubs which would make container shipping more competitive. Electric trucks with autonomous piloting are also on the way and they will lower costs across the board for inland freight. Drones and terrestrial robots look like they will eventually lower the cost of final mile delivery.
It currently costs ~10,000USD to ship a 40ft container from China to Australia. But a small autonomous ship could transport an individual container that distance at a cost of $300 to $500. And large ships are much more energy efficient than small ones so there is still plenty of room to lower ocean freight costs.
Governments and their primary supporters are capturing more of the pie. This dampens economies and therefore makes them cheaper to disrupt by going to war.

Land is getting harder to purchase. Most countries are lowering their official cash rate which primarily has the affect of making mortgages cheaper and land more expensive. And given that industrial land often requires a much higher deposit than residential it will become harder for new businesses to gain access to land. Cost of capital theoretically should decline with lower interest rates but without legal reform I would expect only a small drop in cost of capital.

War is getting automated. This reduces the loss of life costs in all wars but increases the marginal cost of military spending in evenly matched fights. In world war 2 Russia made up for a shortfall in military machine production with additional expenditure of life. In future wars this would be futile. Closely matched rivals will bankrupt themselves in producing machines. While unequal wars will be cheap for the technologically superior. The net result will be that I would expect a big increase in R&D spending in an attempt to create the unequal technologies that makes for low marginal cost of war.
Politics is moving away from free trade and imposing higher transport costs in the form of tariffs. This is driven by the inequality within most wealthy countries that has itself been the result of many dumb policies they have adopted. This had made people unhappy and they are tending to blame free trade and immigration. They are partially correct though restricting trade won't make anyone richer even if it makes everyone more equal. Though restricting immigration is probably a good idea for most countries since they lack the subtlety to implement liberal immigration policies that prevent the downsides of immigration. This trend though reduces the value of trade and therefore increases the odds of war.
Overall most trends are making war more likely in the future though I expect them to be between unequal powers and with minimal loss of life. And I'd expect them to be under the pretense of protecting foreign investment of the citizens of the more advanced country in the less advanced country. And I'd expect some of these small wars to become cold wars with counter parties providing machinery of war to the less advanced country in the hopes of preventing the aggressor acquiring the resources that would change the balance of power amongst advances countries. In the long term I expect this to result in smaller countries being assimilated into larger ones.
We want governments to compete on their ability to provide cooperation. But instead it looks like they will continue to compete on ability to inflict destruction for the foreseeable future. And when they are done with that it's likely they will of consolidated into even larger entities than they are now. So they will still lack the spirit we want from them which only non violent but vigorous competition can provide.
In order to achieve that we really need to separate territory from government to some extent. And by that I don't mean making government virtual or anything like that. I simply mean to make governments less greedy of land somehow. So they leave space for competitors to spring up. Rather than to claim all the land they can first then worry about governing it. They should instead claim only the land they really need and leave the rest for others to find uses for. Obviously governments are going to feel uncomfortable leaving space for competition close by. So how do we make them do it anyway.
One option is to use the threat of violence. This is what turns mafia businesses into legitimate businesses. But I'd like to avoid this option if possible because the entity in control of the violence will always cause problems of it's own.
My preferred option is to find a cost structure for the use of land that is enforced through some automated mechanism and naturally causes governments operating within the land mass under this cost structure to use only the minimal amount of land. Where would this land mass come from? It would have to be leased from some existing sovereign entity out of some land they see no use for. Probably a desert area that is close to the ocean and therefore could be terraformed without affecting the surrounding country and it's water cycles.
This cost structure would entail tessellating the land mass into $1m^2$ chunks. These chunks would then be made available for whoever is willing to pay the highest ground rent. Since they can only rent the land they have no incentive to capture more land than they need. The money captured from this would be split evenly according to the number of chunks rented. Effectively this acts as a transfer from high value land to low. Some of this money could also be allocated to public projects according to a direct voting process, with voting power allocated according to the proportion of rent paid not land rented. These projects would increase the rental value of the land around them so they would often times pay for themselves.
One tricky problem with land rent systems is determining the value of improvements built on the land. Land and improvements necessarily are a package but they need to be treated separately so that the act of spending capital on improving land doesn't have any affect on the rental value of the land it's built on. If it did then the person making the improvements would be charged twice for the improvements and would therefore choose to let other people make the improvements.
The solution is have bidders bid two values. One for the rental value they place on the land and another for the value of the improvements built on the land. The improvement value can then be converted to an annuity based on the market value of money and then combined with the land rent to form the bid value that will be compared with other bids to determine the winner of the auction.
If the winning bid is one where the $improvement$ component is negative then the winning bidder will be allocated that amount on completion of demolition of improvements. The market value of money would be determined by a smart contract oracle. However, there is a problem. If the oracle provides a market rate higher than a given bidders actual cost of money then they will bid a land rent of $0. Otherwise they will bid an improvement value of $0. This is undesirable since we want to know how the market truly values land. But we can solve this by making it compulsory to take a loan for the improvement value at the market rate until either the improvements are demolished or stewardship of the land is transferred to someone else.
I believe this system would prevent wars because it provides a mechanism for appropriating the resources of a competitor in a way that's fair and proper. Any act of war would probably be more expensive when all costs are considered but besides that it would be completely unjustifiable to declare war for resources when there is an easy non violent alternative that everyone else is following. And with no casus belli the repercussions are likely to be very severe. And the desire for wars over religion or culture would be very low since land rent would keep such countries from claiming more land than they really need. As a result the existence of a communistic society would have very little affect on a capitalistic one. The expansion of one would not alarm the other because they know there will always be land for both as long as they are approximately as economically efficient.