Even though iPhones retain resale value longer than their Android counterparts, once they are removed from the software update cycle, they become less desirable to second-hand buyers.
iPhone X, iPhone 8 and earlier models incompatible with iOS17
Indeed, in addition to no longer having access to new features, they do not benefit from security patches, making them more vulnerable to hacker attacks. Thus, Apple recently announced that the new iOS17 update for the upcoming school year will not be compatible with the iPhone X and iPhone 8 (and earlier models, of course). Suddenly, it's now or never to resell them because the closer the deployment date of iOS17 approaches, the more these smartphones will lose value on the second-hand market.
iPhone X/iPhone 8, resale value down after end of June
This is what the SellCell site says, based on the experience observed last year. The iPhone 6s and 7 were then the models excluded from the new iOS16 update. And between the time iOS16 was announced - early June - and its public release - September 12 - smartphones lost 42.8% of their value. SellCell suggests reselling your iPhone Xs and 8s before the end of June if you want to get the best price for them.