Most dealerships do not lend their own money. They act as an intermediary for a finance company, and they earn from arranging the loan. That earning can come from a commission or fee paid by the lender, from fees added to the loan, or from add-on products sold alongside the finance.
This is a legitimate business model. It simply means the finance quote is a commercial offer being made by someone with an interest in the outcome, in the same way the car price is. It is not a neutral service provided for your convenience, even though it is presented that way at the point where you are tired and want to go home.
Australian regulation has tightened here. Flex commissions, which let dealers set your interest rate and take a cut of the increase, were banned by ASIC from November 2018, and responsible lending obligations apply to dealer-arranged finance as they do to any consumer credit. But dealers still earn from arranging finance, and the rate you are quoted is still frequently above what the same lender would offer you directly or what a competitor would offer.