As others have mentioned... the registry is the cause.
Some games, especially older ones, didn't have so many registry entries.
These days, the AAA games do have a ton of registry entries.
You can install the game on a different drive, and if you're very lucky, you could just create a new shortcut to that game after a Windows reinstall. This won't work for all game of course... but it may for simpler or older games.
Games from the MS store, probably have many registry entries. They are tied more fully into the operating system.
Why MS does this I'll never know.
IMO, there should be a basic OS then add-ons like games or Apps, would work like plugins.
This would be to "our" advantage, but not necessarily to Microsoft's.
MS wants us fully dependent on... Microsoft.