I'll let others do the math on depriciation rates, as the point is that Apple supports their phones. Hell, iPhone 5's got an iOS update last month, and that phone was released in 2012. If you buy an iPhone, you know that a) it will be supported for a good long while, and b) as a result, its resale value will be high.
Apple's trick is to realize that high resale values help sales, not harm it. It likely helps that they get a good slice of profit on app sales, but it's not clear to me that cheaper handsets would lead to proportionally more app sales. And it helps that no manufacturer can swoop in and release a cheaper iOS device to challenge the market for used iPhones. So it might not be enough to persuade rando Android handset manufacturers to support devices, but this might explain why the Nexus lineup was replaced with Pixels.