Even if you understand buying a wholesale and selling at retail, when you're trading in a car and the dealer says it's worth $5000, and there's an identical car on the lot for $9500, that stings...
Does the dealer make $4500 on that deal? Maybe. But not likely. Here is a more typical scenario based on where I work:
wholesale trade $5000
sent to 3rd party detail company $250 (up to $400)
mandatory inspection $150
perform required repairs, on a $5000 car I'd say average $400.
So now the car is on the lot and the dealership is into it for $5800.
Best case scenario: Somebody comes and pays full price within 30 days, dealership profit on sale is $3700. Possible but not likely.
More typical scenario: Somebody comes in with a trade worth $100 that they think is worth $2000, plus they want a discount of $2000. So we give them the $2000 for the trade and we saw off at $500 discount on the price. Profit on that deal is $1300.
Worst case scenario: The car sits on the lot for 120 days before somebody looks at it. It's winter now and it now needs a new battery. Dealership is into the car now for $5950. By that time, we have lowered the price to $7000. Customer offers $5000. He agrees to $5500. The dealership loses $450.
If the guy originally trading in the car can provide a guarantee that the first scenario will happen then we'd gladly pay him more for his trade. Since that's not possible ...