The United Nations is the world's governing body. It proposes and votes on resolutions, which are then binding on all member nations. In other words, it's a hot-bed of political intrigue and double-dealing.
Any nation may join the UN (provided the user doesn't already have a nation in the UN and has provided an email address), but it's not compulsory. As non-members, nations are unaffected by any UN decisions. The UN enforces its newly passed resolutions by means of the Compliance Ministry. Acceptance of new resolutions is not optional for members - compliance is mandatory.
The UN in Gameplay
Some players use the UN as a place to exercise their political muscles and propose resolutions that will impact other UN member nations to better reflect the author's ideology. Others see an intellectual challenge in using the proposal process to understand compromise and consensus. Some just enjoy the act of writing up proposals in legalistic language that will nonetheless be acceptable to the majority of players.
Another aspect of UN play manifests in active attempts to manipulate the voter pools. Proposal writers will present their case on the forums, actively campaign via telegram, or use the offsite forums to bring their case to the Delegates. There have also been hints of organized groups splitting into multiple regions and electing multiple delegates, expressly for the purpose of influencing the UN approval process.
A nation's national statistics are also affected by UN resolutions. A large group of nations are not members of the UN for this reason, as they don't want UN activity to "destroy" the nations they've built. Another reason for the low overall percentage of nations in the UN is puppet activity, though there is probably no way to determine the actual ratios of Anti-UN activity versus the various puppets nations.
The UN in Roleplay
UN members may create and vote upon proposals, which upon passage become resolutions. Passed resolutions have the force of law in all UN member nations, regardless of when they joined the UN. Using the UN forums, Civil Headquarters posts, and a variety of offsite forums; UN members can roleplay their national interests towards these laws that affect their nations.
The UN also has a number of standing UN Committees, some of which are managed by the UN Secretariat. Unlike the RL United Nations, the NS UN does not have a Secretary General or a Security Council. The NationStates United Nations is also forbidden from maintaining an army or directly intervening in wars, though its members are encouraged to aid each other in time of need.
As an alternative for roleplaying purposes, the nation of Sovereign UN Territory claims to head the UN. (Specifically, Catherine Gratwick claims to be secretary-general.) This is, however, only for roleplay possibilities when interacting with those who recognise them.
Whether the UN even exists in the realm of RP has been a subject of minor controversy among players of NS. While some International Incidents roleplayers claim the UN is merely a Gameplay instrument with few IC applications, numerous forum RPers (including Ariddia, Knootoss, Kelssek, Bazalonia and others) nonetheless acknowledge the UN as an extant NS institution.