edit: iPhone 5s from 2013 received an update this year
They only do it when there's clear evidence of in-the-wild exploitation or it's a big compatibility bug that would prevent you from migrating to a newer device.
Google's announcement was for full OS support for 7 years, not just security fixes. Comparing it to Apple's ~6 years of OS support is fair.
Quoting from Apple’s page [2]
> “Note: Because of dependency on architecture and system changes to any current version of Apple operating systems (for example, macOS 13, iOS 16 and so on), not all known security issues are addressed in previous versions (for example, macOS 12, iOS 15 and so on).”
[1]: https://arstechnica.com/gadgets/2022/10/apple-clarifies-secu...
[2]: https://support.apple.com/en-us/guide/deployment/depc4c80847...