Doublecheck MacOS for a comparison. Apple cuts off security updates at the 3-year mark for a given MacOS version now and function improvements even sooner than that. iOS similar. The Android version in your cellphone... likely similar.
That's not correct. Apple provides full MacOS updates for 6-7 years - the current release, Sequioa supports a lot of hardware from 2018 and 2019. When they no longer release new OS versions for the hardware, they still supply security updates for a couple of years more. Similar for iOS - it also supports 2018 phones, and if they no longer support that with the next release it'll have security updates until 2027 or so. 9 years is a pretty good lifespan for a phone.
What Apple is pretty bad at is software backwards compatibility - 32 bits software hasn't run for years, leaving a lot of software behind. And when they drop Intel backwards compatibility, it'll be even worse.
Microsoft - evil as they are - are much better on these aspects of computers. Games from the 90s still run - as do my old games on my Xbox.