Compatibility issues usually come down to the difference between backward and forward compatibility. Older games are often backward compatible, meaning a game labeled for, say, Windows 98 will generally still run on that era's systems. However, they aren't forward compatible, so a very old game may struggle on a much newer operating system like Windows 10 or 11.
In those cases, compatibility modes, virtual machines, or fan-made patches can often get an older title running again.