After the collapse of the Soviet Union, Nato was an alliance in search of a role.
Some suggested that if Nato did not "go out of area", beyond Europe, it would "go out of business."
Russia's annexation of Crimea in 2014 revived Nato's central importance as a counterweight to Moscow. But the alliance still seemed on its way to obsolescence, hobbled by a lack of purpose and disunity.
Former US president Donald Trump ridiculed it and threatened to abandon it. President Emmanuel Macron of France bemoaned its "brain death."
The European Union pressed for "strategic autonomy" from Washington.
But Russian President Vladimir Putin's extraordinary new demands and threats, following his military build-up on the borders of Ukraine, has brought Nato back to basics - containing Russian power and imperium.
Mr Putin's insistence that Nato stop enlargement and remove allied forces from member states bordering Russia would draw a new Iron Curtain across Europe, and that threat has concentrated minds.
It may be just what a lagging alliance has needed. "Nato relies on momentum, and a lot of the momentum is generated by a sense of threat and fear," said Ms Andrea Kendall-Taylor, a former senior intelligence officer dealing with Russia, now with the Centre for a New American Security.
After last year's fiasco of Afghanistan and the humiliation of France in the Australian submarine deal, she said, "We were all thinking that we have serious problems in the alliance, and we might need to rethink the foundation of this relationship."
But in talks this week with the Russians, Nato leaders spoke with exceptional unity for a 30-member alliance whose commitment to collective defence was increasingly in question.
The talks allowed Mr Putin to revisit Russian grievances over how the Cold War ended, in hopes of placing them back on the table for renegotiation 30 years later. His deputy foreign minister Alexander Grushko even warned the alliance off a "policy of containment" of Russia and insisted that "free choice does not exist in international relations" - suggesting that Ukraine would have to bow to Russian wishes.
But the more the discussion evoked the Cold War - with its firm dividing line through Europe, and its competing Russian and Western systems and spheres of influence - the more it reminded European and American allies of Nato's purpose.
"Deterring Russia is in the DNA of Nato, because Russia is what can bring existential threats to European nations," said Dr Anna Wieslander, chair of Sweden's Institute for Security and Development.
That threat now is more than territorial, she said. Russia is also trying to undermine Nato's democratic cohesion. "Russia is targeting our elections, our social media, our Parliaments and our citizens, and it is become more obvious now that Russia is not part of our value system," Dr Wieslander said.
As it drafts a new strategic concept to be ready this year, Nato is concentrating on "resilience" against new hybrid and cyberthreats, highlighting its defence of the democratic institutions of member states, not just their territory.
Nato is especially important now for those states bordering Russia, like the Baltic nations and Poland, a country which has had deepening strains with its European partners over the protection of core democratic principles, which Brussels has accused the government in Warsaw of eroding.
But the current crisis is a reminder, even in Poland, of the importance of the alliance as a whole, and not just the country's bilateral relationship with the United States, said Mr Piotr Buras, head of the Warsaw office of the European Council on Foreign Relations.
Ukraine has proved especially vulnerable to Russian threats perhaps precisely because it is not a Nato member.
"In Poland, there was concern that Nato would lose its focus on Russian security threats, but now it's obvious that this is the only framework that can protect us and provide long-term security," Mr Buras said.
There was also anxiety that US President Joe Biden, in trying to stabilise relations with Russia to pivot towards China, would bargain away forward-based Nato troops in Poland and the Baltics that were deployed after 2014.
"But there is no sign that the United States will give in on fundamental issues to Nato," like its open-door policy and its right to deploy forces in any member state, Mr Buras said, and Washington has been rigorous in briefing its allies about its discussions with Russia.
Still, he said, the current crisis "is a very clear consequence of the US pivot to Asia and the realisation of Russia that it might now take advantage of that re-orientation of US fundamental security interests," he said. "And that issue will not go away soon."
Russia will continue to press for a new security framework in Europe, and Europe without the United States is not prepared to play any significant role, he said, so "for Poland, Nato is the key and irreplaceable element."
Even as Poland's battle with the European Union over the rule of law still festers, it is not an overt issue in the military alliance of Nato.
But it was very noticeable that as the crisis over Ukraine mounted, President Andrzej Duda of Poland chose to veto a law, criticised by Washington, which would have stripped majority ownership of an independent television station from an American company.
As the security situation in Central Europe has worsened with Russian aggression and threats, Poland "got what we finally wanted when we joined Nato, which is allied and American troop presence on our soil - to finally bring Nato deployments beyond Germany," said Mr Michal Baranowski, who heads the Warsaw office of the German Marshall Fund.
That is precisely one of Russia's current demands - that those deployments in Poland and the Baltic States be removed, a demand rejected by Mr Biden and by Nato, to Poland's relief.
Still, Mr Baranowski said, the Russians have mobilised the largest military force in Europe since 1989, "and that's scary".
The alliance, he said, "is closer to military confrontation, but at least we have not folded".