We set up NATO shortly after WWII in order to keep the Soviets from gobbling up western Europe the way they did eastern Europe. In those years the European countries were still all smashed up from WWII and pretty helpless against the USSR. The NATO treaty was mostly D'Artangnan's cry from the Three Musketeers, "One for all and all for one". It told the Soviets that the United States would resist any further takeovers in Europe.
And it worked. The Iron Curtain stayed where it was, and didn't move west.
And in 1989 the Soviets collapsed, ending the threat for many years. NATO kept going, doing a bit here and a bit there, helping out in Afghanistan. Until we got Putin in the last few years and all of a sudden, the Russians are looking dangerous again. Since Georgia and the Ukraine, and Syria, the Europeans can see a need for NATO, especially the eastern Europeans like Poland and Lithuania, Latvia, and Estonia.
I dunno where Trump is coming from when he calls NATO obsolete. It is an anti Russian alliance, which was needed in the 1950's and look to me like we still need it in the 2010's for the same old reason.