A state is a human construct intended to minimize the chances of war inside it. We regard any kind of violence within our borders as illegitimate: murder and gang warfare are crimes that we prosecute. The recent dispute between New York and New Jersey over ownership of Liberty Island did not result in either state sending its militia against each other. Elections, the right to lobby your representatives, ask the executive branch for help, or appeal to the court system, are all alternate pathways which help to minimize violence.
Someone pointed out decades ago that the United States is a democracy on the inside, and a murderous bully on the outside; this was in the time of the Vietnam war and CIA-sponsored assassinations of foreign leaders like Patrice Lumumba and Salvador Allende. It is true that we do not play by the same rules internally and externally. In human prehistory and history, you can trace a similar development, analyzed by the philosopher Peter Singer in his book The Expanding Circle: humans first regarded the family group or tribe as the only humans worthy of consideration; later, larger units such as villages or regions became the focus; after that, nation-states, and today the prospect exists that we may regard the entire human race, or even (Singer speculates) all living things as "inside the circle."
A Martian contracted to study human society and make recommendations would certainly suggest that, if life is safer and more secure on the inside, we expand the inside to include the whole planet. Any way you slice it, a global government or at least a federation of individual states joined like the American states by a strong federal government is the key to eliminating behavior on the world stage that is not internally acceptable within our borders.