Nintendo has the biggest IPs on the handheld market: Mario, Pokemon, Animal Crossing... Along with smaller franchises like Fire Emblem, Brain Training, Tomodachi life, Nintendogs... Most of Nintendo's franchise work really well on handhelds.
That combined with third parties bombs like Tetris, Dragon Quest, Monster Hunter, Youkai Watch... basically has allowed Nintendo to run unopposed on that market.
Even the big PSP couldn't harm Nintendo in that regard. Mobile has reduced the handheld market, not the influence Nintendo has over it.