Every simple code base / API is faster than mature API’s due to the fact they do less. A simple string handling library which isnt biderectional, doesnt cater to people with accessibility, doesnt take locale formatting into account, doesnt cover 100% unicode spec will always be faster than complex code that does.
Code and kernels that target known hardware doesn’t need dynamic conditional code to handle unpredictable hardware. This will be faster.
General purpose operating systems handle printing events, background updates, periodic online checks, network discovery, maintenance jobs etc, all these operations consume resources and time.
Yes, Steam deck on Linux will run faster than equivalent games on Windows. But Steam deck on a smaller OS like Haiku will run even faster than Linux.
Engineering is a compromise. A F1 car can corner faster than a passanger car. But it probably sucks to reverse park. Also, I cannot imagine using a sports car for grocery shopping and hauling furniture from Ikea.