Google’s hardware track record is a joke compared to Apple.
https://www.heise.de/en/news/From-June-20-EU-gives-smartphon...
In other words, manufacturers aren't required to publish updates at all, but if they do provide updates they have to make them available to users for five years after they stop sales. This only stops the case where a manufacturer ships a device and publishes updates for the device, but then takes those updates offline after they stop selling the device (but before 5 years is up).
https://www.theandroidportal.com/motorola-android-update-loo...
I'm having a hard time googling it since every result that comes up is about Google cancelling Nexus phones entirely way back when, but I remember a lot of Nexus users were kind of PO'ed about it.