Apple products do well on the second-hand market because Apple usually doesn’t cannibalize that market by selling low-end devices. By positioning themselves as a premium brand and ensuring that the low end of the market is not served with new products, they ensure that the low end will be served by the second-hand market. PC/Android can’t do this because they don’t control the hardware and there’s always some brand that will sell new low-end devices which compare favorably to any used device.
In the few cases where Apple has deviated from this strategy of not serving the low end, resale values have suffered. The iPhone 8 and iPhone X were released at basically the same time. But the X currently sells for roughy 25% of its original price whereas the 8 sells for closer to 15%. This is due to the introduction of the SE which is basically just a cheaper and better 8.