Earlier quoted context omitted.
My M2 MBA routinely goes past 10-16 hours of life time with simple coding stuff (phpstorm and PHP in Docker), and it stays comfortably cold all time. Most Windows laptops struggle to get more than 3-4 hours and will fry off your balls if used as actual laptops.
The poster was apparently a 100% Linux person previously, though. I’m pretty sure Windows was designed to heat up like that as a funny joke. For example on Reddit I see somebody complain that they only get 5 hours with my laptop model (zenbook flip 13) https://www.reddit.com/r/ASUS/comments/ry0nwb/the_asus_flip_... But it is pretty easy to get 14 in Linux I think, at least if you believe the battery indicator.
Huge differences come probably from the lack of user skills, less about the OS. Or just broken drivers.