Putin was not afraid of NATO, but of democracy. Democracy is contagious and what Putin fears most is not being able to continue being a dictator.
While the U.S. have never been invaded by a foreign power (Pearl Harbour doesn't count, it's a joke in comparison), Russia was invaded by
Charles of Sweden, Napoleon and
Hitler. In the latter invasion, Millions of Russians lost their lives. The Leningrad siege alone killed
400,000 children.
Against this background, and against the history of NATO enlargement, you may understand (or not?) that the idea of Ukraine joining the NATO was never particularly popular with the Russian people, Putin included:

21 years ago,
Putin gave a remarkable speech at the Bundestag, the German parliament. The essence: Russia and Europe should work towards peaceful coexistence, despite the trauma of the past.
Now there are two possible hypotheses:
1. He meant what he said.
2. He planned already in 2001 to conquer Europe.
Since I can't read Putin's mind, I don't really have an answer to this. I do like
hard facts, though:
In 2021, Russia spent around $66 billion on its military. NATO’s European members alone spent more than four times that. The United States spent more than eleven times that much ($801 billion)
How plausible is the thesis that
Putin wants to invade Europe?
Btw I don't share your idea that
Putin fears most not being able to continue being a dictator. He had, and still has, an overwhelming majority of supporters in Russia. He is an
elected dictator and oligarch. I wish that he be held responsible for the war crimes committed in Ukraine at The Hague, but I also wish to see next to him those who provoked this war by laughing in his face when he asked for a guarantee that Ukraine would not join the NATO about one year ago.