Apple has much better support for their phones, you can get iOS 17 on Xr which was released in 2018. On the other hand pixel 3 which was also released in 2018 lost official support with android 12 but of course in android you could just flash a custom rom and call it a day. So I don't think it's fair to say you need to upgrade every "couple" of years given the average user probably upgrades every 3-4 years regardless if they use iOS or Android.
Apple has much better support for their phones, you can get iOS 17 on Xr which was released in 2018. On the other hand pixel 3 which was also released in 2018 lost official support with android 12 but of course in android you could just flash a custom rom and call it a day. So I don't think it's fair to say you need to upgrade every "couple" of years given the average user probably upgrades every 3-4 years regardless if they use iOS or Android.