I don't know that a car always depreciates, and I'm sure they don't have to depreciate much. I've sold a couple for a few hundred less than they cost me after several years of use, and the most recent car I lost in a wreck, and the insurance payout to total it was more than I'd paid, over two years and nearly 100k miles later, plus I got to keep the car. For parts, not to drive, but still.
So either there was a mistake on the insurance side and they gave you more than the car was worth, or you got the car for nearly free? You're implying that someone can buy a car, use it for 100k miles and then sell it for a profit..? If this did happen to you then it's the exception and definitely not the rule. I would be truely impressed if it was repeatable.
Pretty easy to do, if you put on miles quickly. Buy a cheap old car with >100k miles. Put on 100k, and it will have depreciated a negligible amount. Take decent care of it and/or get a good deal on it to begin with, and you can sell it for more than you paid. There is a "sweet spot" on the depreciation curve that will result in deals like this, or very close to this, but it varies from car to car and you need to know a little about cars to accomplish it. Certainly not the norm - but most people don't care enough to try.
My last DD I purchased for $1K, put about $1K in parts into it, got rear ended (just scratched the bumper) and got ~$800 for repairs and sold it for $2K (un-repaired).. 15K miles later
My DD before that, I purchased for $1K, got rear ended and received $1600 for repairs. Continued to drive the car (un-repaired) until I had put 40K miles on it, then sold it for $1300. So yes, I basically got paid $1900 to drive that car.
Even discounting insurance money, I'd still have profited quite a bit off the above car.
Current DD I [over]paid $3K for with 100k miles. I've put 29k miles on it. Hope to keep it another 50-100k miles, then sell for $2k. Not a profit, but pretty damn low cost of ownership.