Treble’s great, but overall it’s still not iOS competitive. For example, the iPhone 4S and 5 got 4 years and 10 months of OS support, and the 5S that launched 4 years ago got iOS 11 and presumably will get all the updates this year.
The "minimum 3 years support" for the Pixel 2 and the 4 years 10 months actual support for the iPhone 4S / 5 are not comparable numbers, exactly because one is the minimum they're promising (so it will apply from the date that the phone is discontinued) and the other is the maximum achieved (so it was measured from the model release date).
Anyone who bought an iPhone 4S at the end of its run only got 2 years of support. The iPhone 5 did much better though - 3 years 10 months.
For the the iPhone 5S to reach a minimum of 3 years support, it'll have to continue to get updates for another 17 months.
Google cut support relatively early for plenty of phones, including my Nexus 5. There were endless stupid excuses about chipsets, but the fact remains: nothing past 6.0.1. They barely supported it for two years.
IIRC Google cut support for the Nexus 4 whilst maintaining support for their tablet that used exactly the same chipset. One of Google’s Android engineers even did their own cut+paste builds for the Nexus 4 from the new Android release at the time.
Dropping support at that particular point in time was purely a marketing / management decision that wasn't driven by any technical considerations whatsoever.
When you do this kind of thing as a company over and over again, people notice.
Of course, it may be that it all came down to support contracts internally between Google and the Nexus device suppliers (the Nexus 7 blobs come via Asus, the Nexus 4 was an LG device that used the same Qualcomm chipset IIRC.) but that’s the kind of detail that end users really don’t care about: both were Google devices that Google sold & from the point of view of the end user Google dropped support for one device for no obvious reason as far as the end user can see.
1 - Google has a history of living up to the absolute bare minimum promised. Apple does not. Per history, one can assume that when Google says they'll support for 3 years they mean 3 years and one day, and Apple means about 5.
2 - Google has a history of whining as if they are absolutely powerless, broke, and incapable of affecting what Qualcomm or others do. At least when it suits Google.