It's more about profits than userbase. Nintendo's profit margin on what they sell is insane. Where other companies (like Sony and M$) are selling the consoles at about cost, Nintendo is making a significant profit off of both the console (a glorified tablet) and the games (which are the most expensive, for what you get, in the entire industry.
The Switch was not intended to steal from the handheld market. Nintendo said they would update the 3DS. That still hasn't happened and it seems to have been largely forgotten with the massive success of the Switch.
I grew up on Nintendo and their IP is some of my all time favorite. I just don't get why people will basically buy the same IP over, and over, and over. I bought my wife a Switch and she will defend it like a teenager defends their choice in music.
You mix in the high profit margin, the ramping up of production, and the loyal fanbase and you've got a juggernaut.