It's not really about the computer hardware. Some models will support a wider range of Mac software. Others do not.
It is true that Apple (with an occasional exception) supports the current OS X with full updates, and two more older versions, probably no system updates, but with security updates, and also updates for some of that version's applications. Once a new version of macOS is released, the oldest gets dropped.
And, of course, the hardware that it will run on is usually called obsolete by Apple, and is no longer supported for service long before the software cannot be updated.
It's a long-term game that we play. 😀