I think it's because Nintendo has always kind of been a mobile company at heart. Their games are typically simple and easy to play in short-bursts, which lends them well to handhelds. Plus, Nintendo has always given people what they wanted out of a handheld. Simple, fun, and accessible without fixating on superficial stuff like specs or "maturity". Nearly all of Nintendo's competitors in the space failed because they went in with the assumption that bigger and flashier = better, when in reality, people just want simple fun. The 3DS however, did struggle against the rise of smartphones, but a lot of that had to do with the mistakes Nintendo made with the system and not making itself clear why its different from phone gaming, which led to the system having an identity crisis.
The Switch however, instantly makes itself clear and distinct from conventional mobile gaming by being a home console you can take with you, and features like the Joy-Con that allow for experiences that can't be replicated by any normal phone or tablet. This is the reason the Switch is so successful, it's able to justify its existence in a post-smartphone world in a way the 3DS simply couldn't.







