Taking the 4S as an example because that was my old phone:
Launched October 2011 (w/ iOS 5.0)
Discontinued September 2014
Last OS update August 2016 (iOS 9.3.5)
OS becomes outdated September 2016 (iOS 10 released)
So even if you bought it at the tail end of its availability, you had two years of updates. If you bought it when they were new, you got 5 years of updates.
For reference, the September 2016 release of iOS 10 (which the 4S didn't get) corresponds to the iPhone 7 release. Software for the 4S was maintained through the releases of 5, 5S, 6, and 6S.
Granted it chugged a bit on the newer OSes and developers (especially 3rd party and web developers) started to waste enormous chunks of screen space because they collectively didn't give a shit about anyone who still had a 4" phone, but it's better treatment than you'd have gotten with any Android phone.
iOS 10 launched in September 2016, and I think the 4s was kept current up until then.
Also five years for the iPhone 5 (2012-2017). since iOS 11 supports the iPhone 5s, it will also get its fifth years of updates. (Hopefully more! Mine is still going strong, the arm64 processor was revolutionary.)
Five years does not seem to be an outlier for iPhones anymore.
For reference, the September 2016 release of iOS 10 (which the 4S didn't get) corresponds to the iPhone 7 release. Software for the 4S was maintained through the releases of 5, 5S, 6, and 6S.
Granted it chugged a bit on the newer OSes and developers (especially 3rd party and web developers) started to waste enormous chunks of screen space because they collectively didn't give a shit about anyone who still had a 4" phone, but it's better treatment than you'd have gotten with any Android phone.