I think Microsoft also does quite a good job of maintaining compatibility and slowly bringing people forward (to the point where it's often used as a negative argument). As an outsider, the whole UWP thing felt like a bit of a mess, so I'm not even sure what's the "modern" way anymore to build Windows apps – is it UWP? WinForms? something else?
Apple benefits from having higher average quality of developers in its ecosystem, which allows them to sunset things faster than, say someone like Microsoft, who has to keep things backwards compatible for a decade+. While there are larger applications (Adobe Suite) that dragged their heels on the move from Carbon to Cocoa, a lot of software on macOS/iOS is written by independent developers who do tend more to keep up with the latest frameworks.