In addition to several factors already mentioned in this and other topics, it is worth remembering that this is Nintendo's first home console (albeit a hybrid) to receive a canonical Pokémon game - a franchise that has a very loyal audience. That alone may have guaranteed between 10 and 15 million more potential consumers for the Switch.
Another decisive software for the console's success was Zelda: Breath of the Wild, which attracted several gamers who like open-world games like Skyrim and The Witcher 3 (which, incidentally, had successful ports for the Switch).
It sounds good when you say "For the People", but what you really want is... a stronger army than the Knights, and the evil power to control the people.
(Ramza Beoulve, Final Fantasy Tactics)