What you are doing is comparing a less then a year old products (one hardly couple of months old) when both do have strong support. Try and compare older ones, say iPhone X and Galaxy S9, or whatever flagship released by Samung that year. The older the devices, the greater the resale difference. That's because Samusng devices do not age very well.These numbers don't add up, at least here in the UK.
Looking at eBay sold prices: iPhone 12 Pro Max (used) seem to be going around £750-850 mark. RRP £1099. S21 Ultra (used) are around £800-850, RRP £1149.
Barely any difference. This entire article is basically what one trade-in place has valued phones at.