Let's just say many years of doing this with many different carriers AND manufacturers.
Apple makes iOS, for phones all made by Apple, that are all exactly the same, everything either works or it doesn't.
Google makes Android, for phones made by many different manufacturers, with hundreds of different models and hardware configurations, for many different carriers all over the world, that all want to add there software tweeks on top of what Google puts out, this includes carrier software AND manufacturer software. this takes much more time and work to make sure everything works before releasing to the masses, that's why software updates are far and few between for Android phones, and are pushed out in a "staged rollout" manor...
That's the short explanation