I think what people generally misunderstand is the concept of "markets". They assume there is a console-market and a handheld market and therefore mobile games can steal the players from the handheld market. But the reality is, that there are a lot of people with differing interests. For some of these people these interests align, so they often purchase similar devices. But that is much more segmented, than just two or three markets.
Mobile gaming offered a lot no handheld or console ever could. So they got a lot of new customers that hadn't bought a console before. But for some people the handhelds before were a good enough compromise for their interests and now mobile offered them a better option. These people were lost to handhelds. But I doubt they make a majority of the former purchasers of handhelds.
A successful device often plays to multiple possible interests and therefore can interest more people. So I think 3DS offered less of the experiences the DS offered and had a higher price, so not all DS-owners converted. It is similar to how the WiiU couldn't capture the audience of the Wii. Switch offers a lot more. Alone the feature to be played on TV or as a handheld obvioulsy caters to different interests and can so get different people. The games and their diversity rope in more. Look at the diversity of gaming offering in Switch's first year from Nintendo: Zelda, 1-2-Switch, Mario Kart, Splatoon 2, Super Mario Odyssey, Arms and Xenoblade 2. That covers a lot of different interests and explains why Switch could start so successful.