> ...a 10 year old Dell laptop running latest Windows
Not Dell but Lenovo and not Windows but Linux but for the rest the comparison is just fine to me. If it were not for the switch to 64 bits I'd still be using a 19 year old IBM Thinkpad T42p - I have three of them - daily. I still use them but the things are hampered by their 32 bits Pentium M CPUs. The keyboard and screen still beats whatever other notebook I've tried though...
Is anyone here still running a 2005 Apple laptop? That'd be a PowerBook G4?
> ...or a Samsung Galaxy S3 running the latest android.
I'm using one of those, a Galaxy SIIIneo running Android 11 - not the latest but not out of date either. It actually works quite well for a 10 year old phone, the battery easily lasts for a week with occasional use (and it is user-replaceable when the need arrives). Of course it is not running a Samsung Android distribution, those stopped somewhere around Android 4.4 on this model if I'm not mistaken. No, it runs LineageOS 18.1 with OTA updates, the last update was about a month ago.
So yes, Apple does offer longer support for its hardware than many other vendors. They are outclassed though by the longevity of AOSP-derived distributions like LineageOS on mobile and by Linux distributions on PC-type hardware - which includes Apple hardware, I'm typing this on a "late 2009 27" iMac" running Debian. The thing has been out of support by Apple for quite a while with MacOS 10.13 'High Sierra' being the last supported version. I managed to get 10.15 'Catalina' running on it but that is where it stops. It has no problems whatsoever running Debian 'Sid' (the 'unstable' latest version which in practice is not all that unstable, really) and will keep on doing so for the forthcoming years.