After the "sale", there's a much longer gauntlet of pitfalls and traps to navigate: extended warranties, add-ons (roof racks, floor mats, etc...), financing, trade-in value, anti-theft, pre-paid maintenance, etc, etc... (it goes on and on, it's exhausting).
I'm going to guess, just based on the amount of manhours the dealership spends on the initial sale agreement, versus all the other crap, that the true money is not made by the dealership on the actual car sale, but on all these add-ons after the sale.
[1] - fairly limited, bought 3 cars over the ~15 years, 1 used, 2 new, and it's been about 8 years since my last purchase, not sure how much its changed since then.