At the end of the second world war there was no guarantee that it would not be followed swiftly by a third. Six years of the most intensely murderous and geographically spread conflict in the history of the human species had left unprecedented devastation. From Normandy to Ukraine, vast areas of Europe had been pulverised by aerial bombing and ravaged by savage ground fighting. The landscape was a ruination of flattened homes, wrecked factories and fallow farms.

Great swathes of Asia, especially China, had suffered appallingly. Up to 85 million souls had lost their lives; more millions had been displaced. France and Italy appeared to be on the brink of revolution. Japan’s militarists had been answered with atomic attack and fire bombing by the US. A devastated Germany was starving. The UK had introduced bread rationing, a privation it had managed to avoid during the tribulations of the war. The emergent global superpowers, the United States and the Soviet Union, started to glower at each other across a Europe divided by an iron curtain. The guns of one conflict had barely fallen silent before peoples and their leaders were trembling in anticipation of another.

Yet from the ashes of this terrible legacy was born a new world which would come to enjoy prosperity and peace of a kind not seen before. There would be many more wars after 1945, and some of them would be nasty, brutish and long. The superpower struggle for dominance expressed itself through proxy conflicts in Korea, Vietnam and the Middle East, in dirty wars in South and Central America, and in vicious conflicts in Africa. What there was not again was an all-consuming conflagration between major powers. The total war of 1939-45 was the midwife to a kind of peace.

Some of this is explained by the fear that a third world war would be a last world war. Direct conflict between the US and the USSR threatened to be terminal for humanity once America was deprived of its nuclear monopoly in 1949 and each superpower assembled an arsenal capable of annihilating the planet several times over. They came nerve-shreddingly close to Armageddon on occasion, notably during the Cuban missile crisis in 1962, but the spectre of mutually assured destruction, pithily acronymised as “M.A.D”, deterred them from going over the brink.

There was much more to it than the balance of terror between the superpowers. The world built after 1945 was the result of an exceptionally visionary and creative period of statecraft by a generation of western politicians who had witnessed the catastrophic consequences of the 1930s. Extreme nationalism, ruinously protectionist economic policies and international anarchy had led to the world’s greatest bloodletting.

The western victors responded by striving to create a new world imbued with liberal values and anchored in effective international institutions. At the forefront was the United States. Between 1939 and 1945, the US had more than doubled the size of its economy, becoming the greatest industrial power in world history. America was the only major power to become richer, very much richer, rather than poorer because of the war. When they might have rested on this superiority, America’s postwar leadership determined to try to learn from the follies which had led to 1939. In contrast to the aftermath of the first world war, when the US beat a fatal retreat into isolationism, the most influential figures in America’s political class decided that it was now imperative to be fully engaged. Americans still put America’s priorities at the forefront of their calculations, but by historical standards they were remarkably forward-thinking victors.

General George Marshall, wartime hero and former army chief of staff, became US secretary of state and the leading author of a “European Recovery Program”. Returning from a visit to Moscow, he had seen the desolation in Europe first-hand. In a radio broadcast in April 1947 which paved the way towards what would become known as the Marshall plan, he warned: “The recovery of Europe has been far slower than had been expected. The patient is sinking while the doctors deliberate.” Billions of US dollars was poured into the reconstruction of Europe, including Germany and Italy.

Facebook Twitter Pinterest Posters were used to sell the US’s role in rebuilding Europe to the American public. Photograph: Library of Congress/Corbis/VCG via Getty Images

Never before had a military victor treated the conquered with such generosity. Only a fifth of the aid came in the form of loans. The rest was in grants to minimise the future financial burden on Europe. Ernest Bevin, the British foreign secretary, later described it as “a lifeline to sinking men”.

There was nothing inevitable about this. Republicans in the US Congress balked at pumping so many tax dollars into the rescue of Europe. Stalin forbade Soviet-dominated states in eastern Europe from taking the aid and the Kremlin incited communists in western Europe to agitate against the Marshall programme on the grounds that it was a form of American imperialism. Of course, it was not pure altruism on America’s part to encourage liberal, capitalist democracies. A stable and prosperous western Europe served the United States as a market for its goods and as a barrier to further Soviet expansion in Europe. The point is this: while President Harry Truman and his key lieutenants saw their duty was to uphold the interests of America, they conceived those interests in sufficiently expansive and enlightened terms to reconstruct Europe. The Marshall plan helped to promote not only recovery, but peace and unity in western Europe. Nato, the mutual defence organisation founded in 1949, provided a security umbrella under which prosperity could grow.

This was accompanied by a conviction among postwar European politicians that their continent should never again be the crucible for terrible conflict. Jean Monnet and Robert Schuman of France, Paul-Henri Spaak from Belgium, Alcide De Gasperi of Italy, Konrad Adenauer and Walter Hallstein from Germany along with other “new Europeans” determined to create economic relationships and political structures which would bind together European states in such a way as to make further warfare between them unthinkable. The first Congress of Europe met in The Hague in May 1948. Winston Churchill was the keynote speaker. “We shall only save ourselves from the perils which draw near,” he said, “by forgetting the hatreds of the past, by letting national rancours and revenges die, by progressively effacing frontiers and barriers which aggravate and congeal our divisions.”

Though his own country was reluctant to heed this advice, others in Europe did. What began as the European Coal and Steel Community evolved into the Common Market, then the European Economic Community and ultimately into a European Union of 28 members. No one was ever compelled to join what became the world’s most prosperous trading area. The EU, for all its flaws, is the most successful example of soft power in the history of the world.

To begin with, Britain stood aloof from this inflection point in the history of its continent. This was an error, but it was an understandable mistake. Britain’s second world war experience was unique. It was neither an aggressor nor one of the conquered. Unlike Germany, Britain felt no war guilt. It had not started out on the wrong side, unlike Stalin’s Soviet Union. It had not arrived to combat late, unlike the United States. The superpowers might have the greater armies, but Britain’s lonely defiance of Hitler in 1940-41 had been critical to the prevention of enduring Nazi domination over Europe. Britons wrapped themselves in a proud national legend about their war record.

The close bond with the United States enhanced Britain’s leverage in Europe

This kept out a bit of the chill when the costs were counted. While British self-esteem in 1945 was higher than it had been in living memory, the country’s situation was dire. The conflict had severely depleted national wealth and accelerated the end of empire. It took a while for Britain to shed world power illusions and responsibilities, and the country was taught a rough lesson about its diminished place in the global order by the 1956 Suez humiliation. It then suffered the indignity of Charles de Gaulle saying non to Britain’s belated application to participate in the EEC, only finally joining in 1973.

Dean Acheson famously sneered that “Britain has lost an empire and has not yet found a role”. There was some truth in this when he said it, but Britain did ultimately fashion an effective place for itself in the postwar world. The close bond with the United States, while not always quite the “special relationship” hailed by successive generations of prime ministers, enhanced Britain’s leverage in Europe. Engagement with Europe made Britain more valuable to and influential with the US. The Commonwealth added a third sphere.

Britain played a significant role in promoting liberal, democratic values in what became known as “the western world” and setting them as the standard to which others should aspire. British lawyers and politicians played large parts in drafting the European convention on human rights. John Maynard Keynes was a key player at the 1944 Bretton Woods conference which shaped the postwar financial architecture and was the first international agreement to make a goal of spreading development around the world. This was the beginnings of an understanding that an impoverished planet is an unstable one. The General Agreement on Tariffs and Trade, forerunner to the World Trade Organization, was established to expand free trade and prevent a slide back into the beggar-my-neighbour protectionism which had been a characteristic of the calamitous 1930s. For good or bad, largely good, the western allies embedded liberal norms in international treaties and institutions.

Facebook Twitter Pinterest Winston Churchill addresses the Congress of Europe in The Hague in 1948 where closer European union was discussed. Photograph: Kurt Hutton/Getty Images

The United Nations, born in October 1945, has not fulfilled all the hopes of its founders. It did not stop further wars nor prevent shameful genocides. The UN has provided a global forum for the articulation and resolution of conflict, its agencies have contributed to progress in human development, and it has proved a lot more durable and useful than the hopeless prewar League of Nations.

The result of all this postwar statecraft was to fashion a rules-based international order of a kind that the world had never before seen. This did not serve human kind perfectly, but it was a vast improvement on what had gone before. Among the many gains from the more integrated world which has developed in the decades since 1945, there has been a dramatic decline in the proportion of humanity living in absolute poverty. When the Berlin Wall was torn down in 1989 and the dissolution of the Soviet empire followed, it was briefly possible to believe that the arc of history irreversibly favoured freedom, internationalism and democracy.

This view failed to anticipate the emergence of fresh challenges, such as Islamist fundamentalism, and the revival of old ones, such as aggressive nationalism. Complacency about the economic order and how it distributed the fruits of progress was shattered by the financial crash of 2007-08. This catalysed an ongoing cultural and political backlash against globalisation and liberal government.

The assumptions and structures within which the western world lived for many decades after 1945 now seem much more contingent. The EU is racked with internal tensions. For the first time in its history, it is going to lose a member, and a big one, unless Britain has a last-gasp change of heart about Brexit. For the first time since 1945, the White House is occupied by a president who rejects fundamental tenets of the postwar order and whose assaults on its international institutions are placing western alliances under acute stress. Authoritarianism is resurgent from Russia to Turkey to the Philippines to Venezuela. The totalitarians of China promote their political model as both more stable and better able to deliver economic progress than the messy democracies. Global cooperation is needed as much as ever, not least in the face of the climate crisis, but it is harder to come by. Some find ominous parallels between the troubled second decade of the 21st century and the 1930s.

The conclusion to draw from this is not that human rights, pluralism, open societies and the rule of law are doomed, but that they need constant advocacy, effort and guardianship. This was the key insight of the enlightened leaders who determined to learn from the horrors of the second world war. They grasped that peace, freedom and prosperity can never be taken for granted. They have to be worked for. Better worlds only happen when the vision to conceive them is combined with the will to create them.