There are essentially three ways to finance a car purchase:
(1) Yourself (cash payment)
(2) Third party financing which you obtain yourself
(3) Third party financing obtained through the dealer
The dealer only makes money on the financing via the third option. Your retail installment contract will contain an assignment provision. The dealer will try to get you to agree to a higher rate than they can get from the third party lender who's taking the assignment because the dealer keeps the spread (NPV of the offer rate minus the buy rate). The bigger the spread, the more the dealer makes.
Unless you're getting a published special rate from the manufacturer's lending arm, you can pretty much assume that the dealer is marking up the buy rate at least a point or two. That's why you always secure your own financing beforehand. If you do, you'll find that the dealer is very often able to lower the rate they offer you to at least match what you've obtained elsewhere.