Nintendo's secret to getting away with battery-powered handhelds is simple. Their games do not rely on ultra-shiny photorealistic graphics in order to be FUN. While Microsoft and Sony duked it out over who's got the bigger GPU in the early 2000s, Ninty got busy focusing on gameplay elements that were genuinely novel and entertaining, a strategy that absolutely shines if you're trying to build a handheld constrained by size, power, and (importantly), thermals. Yes, Steam Deck is existential proof that portable PC gaming is possible, but the architecture (both of the system and of the processor) is a compromise on power across the board. Yes, they did a really good job given the constraints they were under, but even well-known and reasonably-optimized titles are limited to 3-4 hours of play time, running at 720p. It's not nothing, but compare that to a Switch.
Now, let's look at big consoles. We've seen a number of triple-A titles being released (prematurely) and running like absolute dog shit, as a result of an utter lack of optimization. In some cases, we've seen updates 1-3 years later, that finally bring performance up to par. Software is a gas, and with increasing pressure to bring a product to market, we've seen developers rushing and cutting corners and being lazy with their algorithm design, rather than taking the time to properly optimize their engine from the start. Or, it's possible that in some cases, even basic optimizations may have existed but were backed out at the last minute due to bugs and a lack of engineers available/qualified to fix them. Looking at you, 343i (obviously).