After the United States show of strength in WWII which reconfirmed their influence and status as the world power and given that no other country at that time has produced or used nuclear weapons in wars.
But in August 1949 the Soviet Union made their breakthrough by successfully producing and testing an atomic bomb.
Giving the tension between the United States and Russia both countries race to build more and more powerful bombs enough to wipe out both countries and constant fear that one country might strike the other and by the 60s each country was having thousands of warheads.
Before both countries came together and agreed to start detonation but before the agreement both countries had spent billions in their various nuclear programs such amount of money would have been channeled into other sectors than endless building of war heads.
Game Theory isn't just academic it's a serious business strategy and even used in international relations and negotiate treaties. And shows the effects to cooperation between nations.
Imagine if the treaties were not signed and agreement made both countries will continue to spend billions and mass produce these warheads.
Which would benefit no one just like in the prisoners Dilemma of both players cooperate they get just a year and it's a win win situation for everyone and everyone is happy and that's it. But lack of cooperation will either hurt one of the players or both of them.
The same as a country's bilateral agreement will make countries agree on decisions that will benefit each of them more than one country trying to outshine the other which can hurt the other country or hurt both of them.