Google itself used to offer 3 years of support. The last 2 generations of Pixels have 5 years. This new phone is 7 years, which is in line with Apple's 6-7 years.
Parts of the system are also kept up-to-date via the app store. Apple released a system update not long ago for older iPhones just to fix a WebKit exploit... Google would release that as an app update, you wouldn't even have to restart the phone. Any Android running a 7 year old OS (Android 7) is still running the latest version of Chrome. On newer Android versions, parts of the system - from the media engine to the bluetooth stack - can also be updated via the store.
Are Android updates messier than iOS? Yes they are. But a lot of what's considered to be "system updates" on iOS are just app/module updates on Android. They happen in the background are keep on going for years after you get a full system update. They don't get any headlines though.