1. The games It opened with Breath of the Wild, a 21st-century take on Zelda 1, and it was a revelation. Splatoon 2 was a follow-up to Nintendo's first big new IP in a while, and it showed it had enough content to be a full sequel. Super Mario Odyssey both hearkens back to beloved 3D Mario games and breaks new ground. The indie games have been numerous and quite clever, filling up the line-up between big releases. Like the man said, "Software sells hardware."
2. Good marketing There were no weird living room cubes full of kids. There was no consumer confusion over what the Switch actually is. The ads for it immediately tell viewers what the Switch is, what games it has, and why you should want it. And those ads are ubiquitous. Wii U ads would appear on commercial segments of kid-targeted cable networks, while those for the Switch are in much more mainstream venues.
3. Underserved audience The Switch is targeted at adults with stuff to do. While it's wonderful to devote a whole evening to your current gaming fix, a lot of people either have to schedule such evenings carefully or accept being tired in the morning. The Switch conforms to a busy lifestyle and lets you enjoy your favorite console experiences even if you're away from home and just have a few spare minutes.