Not to excuse Google but I think their main problem is that Qualcomm stops providing support for their chips pretty quickly which makes it much harder to run newer versions of Android that have newer kernels. Apple controls not just the OS but the chips as well so they don’t have to work around that problem.