Plenty of old apps still run fine. I've got VB6 apps I wrote in the mid 2000s that still run. A previous employer has DLLs from 1999 still running in production on Windows Server - VB6 COM components with hundreds of thousands of lines of code in total. I'm reasonably sure than Office 2000 still works, too.
You do sometimes have to change the compatibility settings and run the apps as administrator (since they were designed for Windows 9x which didn't have separate admin permissions) but often they work.
Even some 16-bit apps work fine as long as you use a 32-bit version of Windows (Windows 10 or older; 11 dropped the 32-bit build). The 64-bit versions of Windows don't have the NTVDM component that's required to run 16-bit Windows and DOS apps. It's an optional component on 32-bit Windows and you need to manually install it.
A lot of effort is put in to backwards compatibility in Windows - Raymond Chen has blogs and books about it.
it often was hit or miss with games though. I remember some games from 95/98 to run on 2000, then not on XP, somehow on Vista and 7, but not on 10. And other games ran on XP, but not Vista and 7...
It's usually the apps themselves doing weird things - Using undocumented APIs, expecting the system to be set up in a particular way, relying on bugs in the OS, etc. Windows tries, and actually emulates old bugs for popular apps so they continue to work, but it can't be bug-compatible forever.
Apps/games that work on XP should mostly work on newer versions as long as you set them to run with Windows XP compatibility (in the settings of the EXE), but there's definitely edge cases.
The disc copy of Fallout 3 will not install on new windows due to games for windows no longer working. At least last time I tried to install it that was the case.
Drivers are definitely out. Some games are really iffy. Especially from the Win 9x era, where they'd do stupid things like look for a 9 in the version string of Windows, or get the amount of RAM as a 32 bit signed int, so refuses to install if you have 4GB RAM or more.
We had a lot of dodgy old DOS programs that were fine under Win98, but XP broke them.