As Apple is always upgrading their devices and technology, older versions of the iPhone become obsolete after a number of years.
Certain old models will no longer be sold by Apple and they will stop offering repairs on them. This is because they are expected to become slow by this point and it is generally easier to update to a new model with better features.
Since the first iPhone was revealed in 2007, Apple has had huge success with their phone and Statista numbers show they had the highest market share of any phone manufacturer in the last quarter of 2021.