I used iPhone 5S for exactly 7 years (2013-2020). The first three years did not cause any problems. Everything was good until iOS 10 in terms of performance and battery. With iOS 11 released in 2017, my device has become unusable. That year I considered upgrading to an iPhone X, but couldn't because my financial situation wasn't good enough.
With iOS 12, I gave up on upgrading completely after taking a breather. After using it for 2 more years, I replaced it with an iPhone XS in 2020. The reason I changed it was purely because the device is now over. I'm currently using iPhone X (I gave the XS to my brother) and I wouldn't change it until the device dies, both hardware and software. My country's economy doesn't allow it anyway. 😀
I live in Turkey and it costs me exactly 25,000 Turkish lira to buy an iPhone 13 Pro right now. Imagine buying an iPhone 13 Pro for $25,000, that's it.