When did they stop providing updates for those?
For the Macbook it was pretty early, I think around 2013. So that's 5 years, kinda like the minimum support timeframe Apple "promises".
The Mac Pro lasted quite a bit longer, last officially supported OS was Mojave, released in 2019, so that's been 9 years (had to purchase a new GPU, though).
Sure, you can keep things running for another 1-3 years without falling behind to much, but even that is getting more and more difficult. Until some years ago, the latest Logic version would usually be running on macOS versions 4-5 numbers behind, today it's 2 (even less than the 3 you get from things such as security updates).
As said, there's no technical reasons for all that. I could still patch my Mac Pro more or less easily (but losing some functionality, which I don't want, especially as I plan to kinda "freeze it in" anyway, once I can afford a new MBA), could've done so for the MB, too.
Thing is, both machines are still running almost perfectly. And while the Mac Pro still is my main machine (it's only starting to cause issues here and there, nothing essential so far, though), I cannot even surf the web with the Macbook anymore. The last working browsers on the last supported OS are too old to deal with most website protocols, let alone things such as YT, forums and what not.
Needless to say, I could still transform both machines into excellent Linux boxes (might even be doing so for fun with the Macbook) and even into half decent Windows boxes. Just the company making the computer doesn't offer me an OS anymore. Go figure.
With the iPhone it was even worse, but I don't exactly remember anymore, I was so happy to get rid of that POS in favour of a most excellent Galaxy S4 (which I used for 6+ years I think). They only changed their policies later on (these days, iPhones are supported quite a bit longer).