They are buoyed by the ever increasing price of a brand new one as with every other car in the world hence we have ancient 330ds and 320ds commanding huge prices.
This particular M4 has actually not lost much in value for the original owner. You might think it has considering a new one starts at 2.2 and most around 2.4 after some boxes, but this would 'only' have cost someone 1.9 or so. This is an 'averagely' specced car in a polarising colour as well which I guess contributes to its outlier pricing. Most of these are around 1.8M which I don't think many owners will be upset about
As they say, in a normal market, 'driving it off the floor' would have normally resulted in it being worth 1.7M (let alone mileage etc). It (like every other car it seems) is doing well by these metrics.