Windows is much better in that there aren’t yearly releases obsoleting machines every year. You can run the latest version of Windows 10 on hardware older than 10 years.
But for the first part, for a huge number of people all you need is a web browser and Microsoft office, which is supported on the 3 latest macOS versions, about the same window as the macOS security updates
Like I said it's not perfect but it's much better than 6 years
When you don’t patch out every serious known zero-day, there’s really no point patching any of them. The device is already compromised.
That means the updates are really only 6-7 years, with an arbitrary cessation.
There’s no reason that Apple should be stopping OS support for older devices unless there’s a compelling reason to do so.
Next year they’ll argue that macOS Whatever only supports Macs with secure enclaves to keep users safe, so that gives them a pass for 2024, but really it’s just continued forced obsolescence as they’ll carry on axing machines for no reason in 2025.
The 2016 (first TouchBar year) is one of the shorter ones for newest-OS-support, only running up to macOS 12 (Monterey). That was released in 2021 and got its latest security update on 2023-06-21.
Going back further, the 2014 Macbook Pro supports macOS 11 (Big Sur), which was released in 2020 and also got a security update on 2023-06-21.
You have to go back to macOS 10.15 (Catalina) released in 2020 to find a version that hasn't had a security update this year. Which MBP models are stuck at Catalina? Mid 2012 to early 2013. That's 7-8 years with the newest OS, then another 2ish years of security updates.
10 years is far from perfect, but it's a heck of a lot better than 6.