Most of the other explanations go over general software and game optimizations, which are (or should be) already routinely performed by the software developers working on the lower layers of the game engine. Whilst this is related to what you’re trying to get at, it’s only half of the picture.
The other half is the fact that the technology stack down to the hardware which the game was originally intended to run on, and the one it eventually gets ported to, can be considerably different. Add to that the fact that the hardware in the PC is a diverse set of parts rather than just 1 configuration.
This is why games need optimizations for a given platform, by which we mean the accounting of these differences by the game developers such that swapping the platform is, at the very least, unnoticeable, experience-wise. As you can tell from the history of PC ports, it’s a complicated problem to tackle.
Latest Answers