Android is an Ok platform only due to OEMs hardly ever updating to the latest OS version to force you into upgrading to the newest phone every year, where as Apple updates phones for as long as they can while launching a new phone every year.
Apple updating to the latest iOS version for as long as possible might be down to the fact that Apple control the Hardware as well as software so it's optimised for more models than an Open Source OS that's not really optimised as highly as iOS is & Apple being a Premium brand want device owners to get the best out of their expensive phones for as long as possible.
Roland