My definition
Just to clarify before we start down this rabbit hole, I don't consider a system you can just take around and play anywhere a handheld console in the true, classic sense. The system also needs to have a library of games you really can't play on any other system or, at the very least, ports or demakes of games from other systems that have noticeable differences due to platform limitations (think stuff like Driv3r on GameBoy Advance or Prince of Persia: Rival Swords on PSP). I know that my definition is narrower than expected, but I want to delineate a difference between classic handhelds and most handheld systems of today.
How it happened
The transformation of handhelds from their own niche to portable versions of home systems happened due to a series of factors over the course of the 2010s. Those factors are: the rise in popularity of smartphones, the rising costs and complexity of making games, and console-quality hardware becoming smaller and, therefore, portable.
Smartphones were really trendy in the early 2010s, as opposed to being the foregone conclusion they are now. We will talk about the real games on those platforms, because most of what is available in the app stores is shovelware that only exists to trick you into buying microtransactions. Because of their popularity, a lot of studios started experimenting with making games for them (and let's be fair, a lot of them were ripoffs of actual PC and console games). Gameloft is my go-to example of a prolific publisher for this market, giving us Modern Combat as a stand-in for Call of Duty, Backstab for Assassin's Creed (and a bunch of Assassin's Creed sidescroller games too, funnily enough), Asphalt for Need for Speed, and the list keeps going. We even got Sony trying to cut a corner of the smartphone gaming market with their own PlayStation phone, the Sony Ericsson Xperia Play, with not much success. Later on, when smartphones became the status quo, we got actual ports of older games, with examples like both of the Knights of the Old Republic games, some GTA games, and even more demanding stuff like XCOM: Enemy Unknown, Alien: Isolation, and Grid: Autosport. Nowadays, the iPhone is getting current releases like Assassin's Creed Mirage and Resident Evil: Village, so even the smartphone games market has gone full circle and has something akin to parity with home consoles and PCs, no more exclusives and experimentation.
Ok, so smartphones were quickly eating away at the portable market. What is next? Well, AAA games just kept going up in development costs, time, and complexity. It sadly doesn't make sense to make a game for only one particular platform, since that limits the possible profits, especially now that a 3-year development cycle is considered short. Indies sidestepped this problem by generally launching their stuff on anything that could reasonably run them, exceptions being games that revolve around hardware gimmicks (like Severed, which only launched on platforms with touchscreens). This problem is currently hitting home consoles pretty hard, to the point that we get Xbox and PlayStation games on PC pretty soon after launch, and now Xbox games like Forza Horizon 5 are being announced for PS5. There isn't much reason to buy a console now, besides brand loyalty and ease of use, and this will lead us into the next point.
Currently, there are three kinds of handheld gaming systems on the market: portable PCs, like the Steam Deck and ROG Ally, the Nintendo Switch family, and gimmicky consoles like Playdate and Evercade EXP-R. The first benefit from the absurdly large library that is almost the entire PC market and access to multiple marketplaces to purchase games (between Steam, GOG, Epic, and numerous key sellers), but also a lot of freedom in how you use your system, seeing it is basically a PC with a bolted on controller on the sides. The second is the only console family still benefiting from actual exclusives. The Switch was a consequence of the changing landscape of the games industry in 2017. Instead of chasing raw power and realistic graphics like Sony and Microsoft, Nintendo stuck to their own gimmicks (and absurd prices), resulting in a console that is equivalent to a handheld version of a PS3 or Xbox 360, at the end of the day. The Switch 2 seems to be continuing in the same direction, still focusing on hardware gimmicks and exclusives, with the added benefit of backwards compatibility with the original Switch, so we can conclude that in the console space, they are the only real player. The third and last only exists for enthusiasts and, consequently, are way more niche. Playdate's gimmick is that it is a system geared towards indie devs, similar in design to a GameBoy, but also featuring a crank on the side which can be used as an input in the games. On the other hand, the Evercade is a cartridge-based emulation box, so it caters to retro enthusiasts. To throw some shade towards unnecessary hardware, there is technically a fourth category, the streaming handheld console, the PlayStation Portal, which is competing with Sony's own free Remote Play app and the PS4-only PS Vita remote play capabilities.Conclusion
You can see that handhelds were killed by the quickly changing world around them. Tech advancements have been quick, invalidating the need for less powerful platforms to take on the go, and game development has become more costly and slow, making games for such a niche market risky and not really worth the effort. In the end, we got way more powerful and feature-rich systems, but at the same time, they have way less personality to them. As a secondary and more humorous conclusion, Nintendo may well outlive the games industry itself, seeing how they are outliving all other consoles.
GamingHD Discord: https://discord.gg/CZSXJwy