Just to get new customers. On top of that banks pay a "spiff" to dealers to run their paper through their bank. Dealers will shop for the bank with the best deal for them first and the customer second.
So the dealer probably would rather the customer finance through their bank than pay cash.
Some new car dealers finance through their manufacturer lender, Toyota Motor Credit for example. Again, the dealer is likely getting a "spiff." Getting more of a kickback depending on the amount financed and other factors.