A few reasons:
Portability: It acts as both a home console and a portable system, offering a unified and seamless experience switching between them. It even has a method of doing multiplayer on the go by detaching the Joycons and using them as separate controllers.
Price: It’s a reasonably powerful system in that it can play full console games including some current gen ports such as DOOM and Wolfenstein II, as well as enhanced versions of last generation titles like Red Faction Guerilla and Skyrim, for $300. Smart phones and tablets of comparable power tend to be much more expensive, while laptops are far more cumbersome for mobile gaming and generally must be plugged in to have an optimal gaming experience for more than a few minutes.
Games: Nintendo launched this thing with one of the best games of this (or any) generation in Zelda: Breath of the Wild, and have followed that up with plenty of other strong titles such as Super Mario Odyssey and Super Smash Bros Ultimate. The success of the system in Japan has also resulted in many Japanese developers jumping on board with ports (Dragon Quest XI) or original titles (Octopath Traveler). On top of that there are many great third party and indie games on the system, many of which aren’t significantly impacted by the Switch being less powerful than PS4 and Xbox One.