Android OEM are incentivized to sell as many phones as they can. They only make money on new hardware. Apple on the other hand still makes money on older hardware as long as the user still buy from the ecosystem. So it makes sense for them to keep the products working longer.