Depends on the vehicle, but a dealer will usually offset the profit on one vehicle against the other. e.g.
Dealer has �10,000 car for sale, but hopes to get �9,000 for it. If you pay cash - nice and easy. If you have a car that you privately value at �2,000, a dealer might offer you �2,500 for it leaving you a balance of �7,500 for you to pay. Now the dealer needs to make �1,500 for your car which he might easily get in the auction (blocking it!) or he could try and sell in on the forecourt for say �2,300 and actually get �2,100 for it, If he did this, it may take longer to sell the longer vehicle, and therefore get his money back, but he would realise - �9,600 all together.
There's a few variations, but if a dealer takes an older car in part ex, he won't normaly try and sell it on, he will trade or block it to avert any problems. Either way, a dealer will have a figure in his head that he wants, and will jiggle the figures to suit.
Hope this helps,
Steve