Seventy years after Nato was founded to protect western Europe from Joseph Stalin’s Soviet Union, the military alliance returned this week to its first home in London to discuss an increasingly sprawling set of goals while bickering leaders competed to see who could offer the most contentious soundbite.

Normally this is an arena that would be dominated by Donald Trump, although this time he was somewhat upstaged by Emmanuel Macron, whose pre-summit declaration that the organisation had become “brain dead” obliged Trump to describe his French counterpart’s comments as “very, very nasty”.

In the end, France pointedly secured in the nine-paragraph post-summit statement recognition that “Russia’s aggressive actions” are in essence as important a threat as “terrorism in all its forms” – an attempt to ensure that the fight against Islamic State is not, as Trump tried to argue last month, over.

Post-summit declarations can only go so far. The growing complexity of the organisation required Nato leaders to negotiate with Turkey, which had refused to sign off updated plans to defend the Baltic states against Russia unless Nato agreed to designate the Kurdish Syrian YPG as terrorists.

This time, diplomacy appears to have succeeded, and Ankara signed up to a new defence plan for Russia’s nervous western neighbours. But it was an uncomfortable reminder how an increasingly assertive ally – with the second-largest armed forces in the organisation – can exert influence, potentially affecting the security of others far away.

Despite this, Nato’s focus continues to spread. The summit is the first time its leaders have considered the rise of China, which has never been a focus for the organisation; they also confirmed that it was time for Nato to have a military presence in space, and they worried about cyberwarfare and Russian disinformation.

But just as the UK debates leaving the EU, Nato is, prompted by Macron’s outburst, deciding itself how to “strengthen its political dimension” – or to put it another way, how it can insulate itself against an erratic US president who nobody is totally sure would defend a fellow ally after the abandonment of the Syrian Kurds.

Trump’s focus, meanwhile, has been on getting other Nato countries to spend more and more on defence. The UK is one of only nine countries to meet the target of spending 2% or more of GDP, but Boris Johnson, eager to keep Trump happy, has already agreed to make real terms increases every year, while China is talked up as a risk.

This has been a triumph of sorts for White House diplomacy – not least because at the last summit in Brussels last year, a belligerent US president had threatened to “go it alone” if other countries did not spend more.

In London, Trump threatened to launch trade wars against “delinquent” states not prepared to spend more on arms, then petulantly decided to cancel a press conference – almost certainly to the delight of Johnson’s Downing Street, a week before an election – claiming a “two-faced” Justin Trudeau had joked about him at Buckingham Palace the night before.

Nevertheless, Nato defence spending has been gradually creeping up: by 4.6% in 2019 among Canada and the European members, a demonstration arguably of what Nato supporters say is the most successful military alliance in history.

But the events of the last two days also serve to underline that Nato is becoming an ever more complex organisation whose persistent squabbling means that questions will linger over precisely how effective it would be in the unlikely event collective military defence would ever be required.