They can only go as far if Apple doesn't deprecate them, unfortunately
Depends on how you look at it. While the hardware might keep functioning and current software might keep running, some devs also deprecate their software. I have an old 6S+ that I keep software that I don't want to install on my actual device. Slack informed me that it will no longer function after a date set later this year. Other apps have already stopped working on it because the devs do not want to deal with it.
TL;DR sometimes it's not Apple, it's the app devs that deprecate them.
I use a 2012 MacBook Air 11" for Zoom meetings. Still runs like a champ. It's stuck on Catalina, but Apple still sends out patch releases.