There are several sources of international law. First is custom, as in diplomatic immunity. Certain practices gradually become customary, are codified into rules and eventually become international law. What to do when two ships are on a collision course? Which way should they turn? The custom (and now law) is that both ships should turn right (starboard).
The second major source of international law is treaties, as in the UN Charter and the UN Law of the Sea Treaty. There are also security treaties like the Naval Disarmament Treaties of 1921 and 1930, the anti-war 1928 Kellogg-Briand Pact, the 1919 Treaty of Versailles which ended WWI, the 1968 Non-Proliferation Treaty, and environmental agreements such as the 2015 Paris Accords on global warming.
The third major source is UN Resolutions, such as the 1991 Security Council Resolution authorizing the use of force against Iraq after it invaded Kuwait, the many resolutions against the Israeli occupation of the West Bank and the UN Declaration of Human Rights.
A fourth source is court decisions by the International Court of Justice (ICJ – aka the World Court) and to some extent, rulings by national courts.
Finally, there are legal writings, ranging from early writers like Hugo Grotius to contemporary thinkers, and general principles of law, as reflected by laws that have been enacted by many different countries.
There are several ways of resolving disputes in international law. If the two sides agree to it, sometimes a third party offers a venue for discussion, helps the two sides to negotiate or arbitrates a conflict. For example, Norway provided a venue and helped the Israelis and Palestinians negotiate the Oslo agreement in 1993.
The apex of international law is the UN’s International Court of Justice (World Court), but agreeing to submit cases to the Court and to obey its verdicts is voluntary. One interesting case occurred during the Reagan administration, when Nicaragua brought a case against the U.S. for mining its harbors. The U.S. was found guilty of acts of war, but refused to accept the decision. Similarly, Iran refused to accept the ICJ decision to release its U.S. diplomatic hostages in 1979-80.
However, there are examples of ICJ effectiveness and obeying international law. In 2004, Mexico won an ICJ case because Mexican citizens arrested in the U.S. were not allowed to see their diplomatic officials as required by international law. As a result of the decision, Bush 2 agreed to follow the law in the future, probably because he wanted to ensure that U.S. citizens who were arrested in Mexico would be allowed to see their embassy people. Reciprocity again.
The scope and power of international law are growing. Despite domestic banking privacy laws, Swiss banks are now opening their records to find money stolen by criminals and government officials of other countries. Switzerland has also opened its books to catch tax evaders from Germany and the U.S. More people are being arrested for smuggling endangered species and for human trafficking (although both laws need to be strengthened). In Ivory Coast in 2010, the UN, the African Union, and ECOWAS insisted that the president step down after a fraudulent election. Similarly, in Gambia in 2016, ECOWAS insisted that the sitting president allow his elected successor to take office. In the long run, international law is becoming stronger and more effective.
One long standing debate involves human rights intervention. If a government is killing its people, can the international community violate national sovereignty and intervene? As Samantha Powers’ A Problem From Hell shows, no one did anything to help the one million Armenians massacred by the Turks in 1915 or the six million Jews killed in the Nazi Holocaust in WWII. No one did anything about the 800,000 killed in the 1994 Rwanda genocide. After Rwanda, UN Secretary General Kofi Annan proposed humanitarian intervention as a policy, but it didn’t happen. One reason was that China was worried about setting a precedent for possible intervention against its own human rights violations in Tibet and Sinkiang. The UN ineffectively interceded in Yugoslavia, but it took NATO intervention in 1995 to stop the fighting.
China buys oil from Sudan, so again nothing was done about the massacres that began in 2003 in in Darfur. In 2005, after much discussion, the United Nations officially adopted the doctrine of the Responsibility to Protect, or R2P, which says that the international community should intervene in cases of genocide or other mass killings. This was used for the first time to intervene in Libya in 2011, when the universally despised Muammar Gaddafi threatened to kill everyone in rebellious cities. But it has not been used in Syria, where 500,000 have died and millions have been displaced. Russia has a veto on the Security Council and is helping its client state Syria with bomber aircraft and troops.