By Steven Erlanger and David E. Sanger, New York Times–

When President Trump left the NATO gathering early and in a huff on Wednesday, it only reinforced the fear that with America distracted and retreating, the West’s celebrated alliance has lost focus.

The 70th anniversary celebrations in London largely illuminated NATO’s uncertainty about whether its primary mission is defending against a disruptive Russia, a threatening Iran, a rising China, or reconfiguring its strategy to deal with an array of new cyber and disinformation threats that it has been slow to confront.

And NATO’s own internal divisions were on vivid display, from Turkey’s disruptive role to the question of whether Europe needs its own defense — independent of the United States — alongside or in competition with NATO.

Mr. Trump, as he often does, focused more on warning member countries that while they have spent $130 billion since 2016, they must do more to share the burden. Whenever he alluded to strategy, it was usually to deflect the focus from containing or confronting Russia.

Everyone else was haunted by President Emmanuel Macron of France’s comment a few weeks ago that “what we are currently experiencing is the brain death of NATO,” a statement he insisted he stood by, even though Mr. Trump, in a turnaround, accused him of insulting the alliance.

For many, Mr. Macron is right. And what he is really talking about, they say, is the lack of coherent American backing — always NATO’s ultimate source of power — beginning in the White House.

“The single biggest challenge is absence of U.S. presidential leadership,’’ said Douglas Lute, a retired army general who served as American ambassador to NATO until 2017. That absence, he said, was a first “in NATO history, which inhibits progress on all other challenges.’’

Mr. Trump eased his critique on this visit, saying that while he had been right to call NATO “obsolete” in the past, the alliance has been revived by his success in pressing countries to spend more on their own defense.

Mr. Macron pushed back, turning the subject to the threats that NATO faces. It was a topic that Mr. Trump did not appear prepared to address, and his flustered response only reinforced the notion among critics that the American president had spent far more time thinking about cutting the cost of the alliance than the threats it must address.

Ian Lesser, a former American official who directs the Brussels office of the German Marshall Fund, said that the subtext of Mr. Macron’s criticism of NATO was growing doubt that Washington would aid a European ally under physical or digital attack.

“When he says ‘brain death,’ he’s talking about American leadership,’’ Mr. Lesser said. “That’s perhaps what Trump is hearing. Trump’s view is that he’s turned NATO around, and the rhetoric from Paris is compromising that narrative.’’

Jeremy Shapiro, a former American official now at the European Council on Foreign Relations, said some leaders assume that NATO will “brush aside this latest scare” because it has survived crises before. But he said the problems are real.

Mr. Macron, he said, “not unjustifiably, sees Trump as turning his back on Europe and wants NATO member states, and the E.U., to wake up to this reality.’’

On Tuesday, Mr. Trump again dodged a clear commitment to NATO’s core belief of collective defense when asked directly if the United States would aid a member under attack — the key commitment in the alliance’s charter. Instead, Mr. Trump talked about military spending, persisting in his mistaken idea that member states who are not yet paying two percent of their gross domestic product on the military somehow “owe” the United States arrears.

“If the alliance is to survive, and maintain its standing as a credible option for Western defense, it will require a new type of bargain — one that prices in American indifference, and that makes up the shortfall with greater European-level contributions and authority,” Mr. Shapiro said. But there is no consensus on the path forward.

Mr. Trump’s possible impeachment also is an issue for NATO. At the core of the inquiry is the accusation that Mr. Trump traded a tenet of the alliance — helping a fragile nonmember, Ukraine, stave off Russian invaders — to benefit his own re-election campaign.

His reluctance to name Russia as the offender in the 2016 elections, combined with NATO’s confusion about the new era of cyber and disinformation threats, has prevented the alliance from leading the way with a unified response to the 21st-century attacks eating at democracies.

Here are some of the main challenges facing NATO’s 29 members.

Turkey

Mr. Trump likes President Recep Tayyip Erdogan of Turkey, and the two met on Wednesday for a session that was not on Mr. Trump’s public agenda. But Turkey has refused to abandon a sophisticated air defense system provided by Russia — a threat to the newest American-made aircraft — and has made clear he wants one foot in both camps.

Turkey is a vital member of the alliance, bordering Syria, within striking range of Russia (which is why the United States still keeps nuclear weapons at a Turkish air base). Everyone except Mr. Trump was acknowledging that keeping Turkey fully committed to NATO is getting harder.

Mr. Macron also challenged Turkey’s definition of terrorists. Turkey regards the Kurdish forces on the Syrian border as terrorists, even when they fight the Islamic State alongside the United States, France and other NATO members. He essentially was asking how long Turkey can play both sides — a question Mr. Trump refused to address.

“Turkey has increasingly become a challenge for NATO,’’ said Amanda Sloat, a former American official now at the Brookings Institution. Turkey is strategically located, has the alliance’s second largest military, hosts more than 3.5 million Syrian refugees, and has legitimate security concerns, she said.

At the same time, fellow NATO members are questioning Turkey’s commitment. Still, Ms. Sloat said, there is no mechanism to expel Turkey and no desire to push it away from the West toward Moscow.

China

This was the first NATO meeting where leaders seemed to take the threat of a rising China as a direct challenge. But it was a muddled discussion.

While Russia may be a disrupter on the edges of Europe, China is a builder. For the first time it has a noticeable naval presence in the Mediterranean, the Black Sea and the Nordic sea routes. It is laying undersea fiber-optic cable, meaning more NATO nations will be communicating over Chinese infrastructure. And those platforms will pave the way for artificial intelligence applications and quantum computing — two areas where China is investing heavily, often in partnership with European universities.

But the immediate issue is driven by aggressive bids by Huawei, the Chinese telecommunications giant, to build 5G — “Fifth Generation” — switching systems in NATO countries, from Italy to Germany to Britain. Early this year Secretary of State Mike Pompeo was warning European nations that if they buy from Huawei, the United States might terminate their access to intelligence.

The reaction against Washington’s ultimatum was so sharp that Mr. Pompeo toned it down. Now several European countries are arguing they can “manage” China’s presence in their communication networks, a bid to avoid so angering Beijing that it retaliates by cutting European imports.

Inside NATO, however, officials are struggling to understand what happens if its day-to-day communications run through Chinese switching systems and cell-tower networks — a vulnerability China could exploit in a conflict.

Mr. Trump waffled on the 5G issue on Wednesday.

“Well, I’m not working very hard on that,’’ he told reporters, a sharp change from the administration’s focus on the issue earlier this year. “Everybody I’ve spoken to is not going to go forward but how many countries can I speak to?” (In fact, several appear to be going forward.)

Macron, Russia and European Defense

The French president sees a leadership vacuum in Europe that he wants to fill. Angry about Mr. Trump’s unpredictability and seeing him as a harbinger of a disengaged America, Mr. Macron is arguing for more “strategic autonomy” for Europe, including the ability to defend itself.

But many in NATO, including Germany, Poland and the nations of the Baltics and Central Europe, say Europe cannot deter Russia without the United States and its nuclear umbrella.

They are also troubled by Mr. Macron’s claim that terrorism, not Russia or China, is the main threat to NATO, and by his outreach to President Vladimir V. Putin of Russia.

“If we want to build peace in Europe, to rebuild European strategic autonomy, we need to reconsider our position with Russia,” Mr. Macron declared in the same interview in which he diagnosed NATO’s brain. Poland’s foreign minister, Jacek Czaputowicz, even suggested that France is “the Trojan horse of Russia.’’

As for European strategic autonomy, few believe that Europeans would spend the huge amounts necessary to be credible. Some think that France would be even less dependable than the United States in defending a small NATO member like Montenegro or Estonia.

American policymakers should not worry too much, argued James Dobbins, a former American official now at the RAND Corporation. “Experience suggests that such initiatives will not get very far,’’ he wrote. “But more important, it would be good, not bad, for the United States if these efforts succeeded. The United States would welcome a more equal partnership with a more united Europe, distant though that prospect may be.’’

At the end of the London meeting, the NATO secretary general, Jens Stoltenberg, still managed to present the appearance of unity. The final declaration recommitted the alliance to collective defense and its spending goals, and Mr. Macron got agreement on a new study of NATO’s future strategy, termed in NATO-speak, “a forward-looking reflection process,’’ under Mr. Stoltenberg, “to further strengthen NATO’s political dimension including consultation.’’

Steven Erlanger reported from London, and David E. Sanger from Washington.

Steven Erlanger reported from London, and David E. Sanger from Washington.