What do car dealers go for when they buy a car?

Hello dear forum, I hope that I am here in the right forum. I always ask myself like car dealers around the corner actually make money?! We have here e.g. a car dealer who always sells cheap used cars, whereby I wonder how much he probably paid for it and whether he earns anything at all on the car. I would like to know 2 things ….. maybe someone knows an answer. 1. Where do the car dealers get the cars from? 2. If I e.g. to a car dealer hi ngehe … he offers me a sum X for my car. Which factors play in his evaluation for a role? Is there a faus formula, where you pay e.g. 20% or 10% under Schwackelist?? Would I be very pleased about an answer :-), since I have always wondered how the car dealers (I don’t mean the car dealerships) earn their money. Gruss Tancok