They tested the waters to see how they fare on it, First iirc was the mario runner, it received ok ratings, then they tried with Fire emblem heroes, welp that got uber ratings but then they stopped and considered "what IP we could use in mobile without our fans wanting our blood"? they decided that "none" picked Cygames and made Dragalia Lost that it feels like it was going to be a Zelda mobile games considering that the controls are almost the same as the two legend of zelda DS games, but they decided to change it, and people actually liked it
Nintendo has learned in all their story that grave mistakes are ALWAYS remembered and they cost dearly, lets be old fags and remember how Sega practically crushed then in the Mortal Kombat incident and more recently the huge backlash for Metroid prime federation force that they had to fix by announcing Prime 4 and the remake of Metroid 2
Thing is, Nintendo played it cautiously, they haven't released anything like SMB or a full Pokemon game exclusively for the phone, it's all been spinoffs.
That and they've teamed up with companies they've worked with in the past, so they've had time to get to know what each other can do.
I mean, we've had Magikarp Jump, which showed that they can laugh at themselves, and even if it's shallow as hell, it's a fun time waster. We've had Pokemon GO, which although not making the billions it made in the first year, is still keeping on making money, helped by the odd news stories generated by it, like the Japanese guy who went out to find Pokemon and ended up finding his missing cat.
We've had Pokemon Quest, which... will break even, it's pretty crap, we've had that Pokemon statue battle game, which made money, there's the Mario Kart racer coming out next year, which will make it's money back in the first month if it's solid.
Nintendo's still experimenting with it, but it's honestly paid off for them. But then again, they just do the announcement via press release, or in conjunction with other games, and then shut the hell up. No phone memes.