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.