I don't know if it's the case elsewhere, but for example in France there is a law enforcing a 10 year warranty for every building or repair on buildings.
https://www.french-property.com/news/build_renovation_france...
Apple aims at planned obsolescence. Those 2007 Macs are still reliable (I have one) but you can't upgrade to the latest OS, so you miss security patches... Same for IOS devices.