My guess is more that many android smartphone companies simply don't find it economical to continue supporting their handsets past a certain period of time.
Right now, there is every financial incentive for Apple to do so. Remember back in 2018 when "throttlegate" was an issue? Back then, I felt that it wasn't so much a problem of Apple trying to trick consumers into upgrading their phones. Rather, the fact that more people were noticing, and complaining, of their phones slowing down after 2 years was a sign that more people were holding on to their phones for longer periods of time.
As such, Apple has pivoted from selling iPhones, to selling to people with iPhones. Yes, iPhones cost more, but they also hold on to their resale value longer thanks to a combination of better build quality and longer software support (which in turn helps offset the cost of upgrading to a newer model in the future). That's why Apple launched the upgrade programme in the first place.
Meanwhile, even if you are still hanging on to an iPhone 7 or 8, Apple still has plenty of ways of earning your money, from apps to services to accessories, by virtue of owning the whole ecosystem. Apple doesn't need you to keep buying an iPhone every 1-2 years. They just need you to keep using one. That's why they have no qualms about supporting an iPhone 6s with iOS 14. That their chips are powerful enough to continue running smoothly even with 6 years of software patches layered on is a welcome bonus as well.
Other OEMs, even Samsung, have few ways of earning extra revenue from consumers after the sales of the initial handset. As such, the inclination to do something that isn't financially beneficial to you is naturally lesser as well.