What does a nation state really do? Today's nation states simultaneously do a lot and very little. They tend to be very paternalistic and constantly expand scope, all while failing to deliver on the basics — like improving common goods or implementing technology that would benefit everyone.
A nation should focus on improving the lives of its citizens and residents. But how?
In an ideal world, a nation state should:
Create a free market system by offering legal assurances around private property and contract enforceability. Free market dynamics then ensure that skilled citizens and residents can provide goods or services and earn money, which they can use to purchase other goods or services that would improve their lives.
Build common goods that help such a free market flourish.
Allocate and distribute its resources in the most effective way to fund common goods.
The most important example is a system of law. A system of law is paramount for free market dynamics to exist, since it provides the required legal assurances. A free market wouldn't exist if agreements are wet paper and private property doesn't exist. There is no incentive in entering an agreement knowing that you will get screwed over.
But for a system of law to exist, common goods like a legislative body and a court system need to exist. A nation state should fund both.
Roads are another example. For citizens and residents to be able to buy physical goods (even food), roads are essential. A nation state should fund those. Obviously private roads can exist, and the state should find the best way to fund the most paramount common goods while not overstepping on the free market. It's a slippery slope once entered — why not fund a state's telco, or a bank, or an ISP? But that is prone to end in monopolies, which can slow down free market dynamics and hurt consumers.
That's why before funding anything extra, the state should ask itself: can this good be provided by the free market? If it can, the state should stay away from it, and instead focus on how to improve itself so that such good can be effectively delivered by the free market.
It's interestingly similar to operating systems. iOS or Android would be nothing without their thriving developer ecosystems. While it's true that the companies behind these operating systems sometimes impose their own apps and kill the third-party competition, it's rare. They mostly focus on building a thriving environment for developers to build. It's all about leverage.
The communist approach would be for one entity to centrally plan and build all the apps they deem necessary. The capitalist approach is to provide a sandbox with ingrained incentives for developers to satisfy user demand. Capitalism might have its flaws, but we can agree that communism hasn't worked very well.
In other words, a nation state should be a thin operating system providing a friendly environment for the free market to thrive.
That way, citizens and residents can do what they are best at, accruing wealth that they reinvest in buying the goods and services that improve their lives.