Don't assume the dealer is paying the invoice price for the car. The manufacturer has all sorts of incentives they offer the dealers that are mostly invisible to customers. These can radically impact the price of the car.
Example- BMW says to dealers that they will pay them $10,000 if they sell...