Windows and Linux actually has binary compiled code specific for each CPU...
x86 Options (Using the GNU Compiler Collection (GCC))
gcc.gnu.org
A binary compiled for K10 for example will run faster on K10 CPUs but probably not in Zen 2 CPUs... it can have issues or even run very slowly.
So Windows And Linux avoid that having optimized binaries for all different CPUs in the market from a minimum requirement (they needs to limit legacy support in new releases).
Think like Windows and Linux as being an abstraction layer API like DirectX, OpenGL, Vulkan, etc... they have binary specific for each hardware arch it supports but like all abstraction layers it runs with overhead.
The situation of games on consoles are different and in the PlayStation 4 specific case all games binaries are coded and compiled specifically for the CPU and GPU found in PS4... that means these games can't run in another CPU/GPU arch without have issues.
With that in mind you have two options:
1) MS BC on Xbox One: where they created a hyper visor (like a virtual hardware) that emulates the exactly same CPU and GPU of the system they are emulation.... so all calls from the game binaries run natively in these virtual CPU/GPU and the hyper visor that deals with all the issues in translate that to the instructions that works with the new new CPU/GPU.
2) The BC way round in PS5: Sony asked AMD to create a hardware compatibility level where the CPU/GPU will act exactly how it was on PS4 or PS4 Pro... how AMD archived that is unknown yet but seems like the PS5 APU can run in PS4 and PS4 Pro mode when needed.
That Sony/AMD approach basically eliminate the issues that you can have running the PS4/PS4 Pro game binaries in the new PS5 APU.
Everything is right now?
Nope... there are the game logic issues... game logic are made using different infinite loops and these loops have a tested speed that works synchronized... but what happen when you even using the same PS4 APU mode in PS5 but with higher clocks? Well it can break that synchronism and generate some weird in game issues.
When you run that gaming logic in the Jaguar actual clocks it seems to works like intended but when you run it in a way faster clocks you have to test and in some cases even fix the issues.... that is why Sony and developers needs to test their games to run in PS5 via BC with boosted clocks.
You will say but games in PC runs fine... well games on PC use abstraction layers that avoid these issues and the dev end with a gaming logic that is not the best for any specific arch/hardware but works fine across every one.
Console to get the best performance have coded game logic specific for the arch/hardware it is running so it can have issues in other arch/hardware.
Game logic issues are very weird because you can have issues because it is running too slow or because it is running too fast.
BTW I tried to be very simple is my explain... the things are a lot more complex than that.