Apple will provide software and hardware support for any given product for at least 5 years. After those 5 years, you sometimes will still get security fixes.
The reason for this is that newer software will start using hardware features and capabilities that only exist on newer hardware, not because Tim Cook is evilly cackling in his office "hahhahha! Let's force people to buy new Macs!!!"
If only there was a way to write software that uses the new hardware features if they're available but falls back to a legacy path, if the hardware features were not available.
The reason for this is that newer software will start using hardware features and capabilities that only exist on newer hardware, not because Tim Cook is evilly cackling in his office "hahhahha! Let's force people to buy new Macs!!!"