Today, there are nearly 200 recognized nation-states in the world. It seems like a natural immutable structure of the world, but it's worth remembering that nation-states as we know them today are remarkably new historically speaking.
The concept of the modern nation-state can be traced back to the Treaty of Westphalia in 1648, which ended the Thirty Years' War in Europe and recognized the sovereignty of individual states within a system of international relations. This treaty marked the beginning of the modern nation-state system and established the principle of non-interference in the domestic affairs of other states.
The rise of the nation-state was closely tied to the development of national identity and nationalism, which emerged in Europe in the 18th and 19th centuries. Nationalism is the belief in the importance of one's nation and the cultural and political unity of its people. It was fueled by the Enlightenment, the French Revolution, and other events and movements that sought to promote individual rights and democratic governance.
As nationalism spread throughout Europe, it led to the formation of new nation-states, as people sought to form their own independent states based on shared cultural, linguistic, and ethnic identities. This process was further fueled by the breakup of empires and the decolonization process after World War II, which resulted in the creation of many new nation-states in Africa, Asia, and Latin America.
However, the ideal of respecting mutual sovereignty has not always been met, and the led to two world wars, fuels modern resource wars, and is the prime motivator behind the war in Ukraine.
Moreover, the unification of a people around a national identity also excludes people who don't share this identity creating a divide between people in the nation-state who get the benefits and outside the nation-state who don't. Proponents of nation-states would argue that it's fine because every person belongs to a nation-state and would thus get the benefits from belonging to that nation-state. However, upon closer inspection, this argument quickly falls apart as some nation-states are much richer and are able to give more benefits than other nation-states. We need not look further than the global inequality. While some countries have robust welfare systems, other countries struggle to feed their people, and vastly different life expectancies. In reality nation-states create (at least) two classes of people whose lives' worth are considered very differently.
We have the resources and the technology to prevent hunger, however, because of dual-class system of people, we don't efficient allocate the resources necessary to prevent hunger. Instead, millions of people starve every day. Many of today's biggest problems such as climate change are on a global scale, and require solutions that transcends individual countries.
The of societal organization tends to follow the speed of information. If we look throughout history, and look at the size of the largest modes of central organization, it tends to roughly follow the distance information can travel in a reasonable amount of time. Today, we have the ability to transmit information across the Earth in milliseconds, so maybe it's time for us to retire nation-states, and organize society on the scale of the Earth.