In other words, you don't really get much of a choice, unless you are buying a flagship device and not everyone will be able to do that. The same goes for the comparatively expensive iPhone devices, the cost also being a factor there for many.
But based on this it seems like the right comparison is between a three year old iPhone and a brand new mid-level android because they’ll last you the same amount of time, and three year old iPhones aren’t very expensive (though it depends on where in the world you live. In plenty of countries ~2yo iPhones cost the same as brand new iPhones at US prices, because you can use them for so much longer than local market android phones).
Many phones are essentially abandoned by the manufacturer and don't receive any security updates not too long after release, which might just be an issue: https://source.android.com/docs/security/bulletin/2023-12-01
Not only that, but many apps won't run on the older versions of the OS either, due to the API level deprecation in Android: https://support.google.com/googleplay/android-developer/answ...
In other words, you don't really get much of a choice, unless you are buying a flagship device and not everyone will be able to do that. The same goes for the comparatively expensive iPhone devices, the cost also being a factor there for many.