You're not giving them free money, you're getting them to pay you a lot more in total over many years by selling them a much more expensive vehicle up front. Instead of, say, $20k over 3 years, they can get $40k+ over 7 years for selling a product that doesn't remotely cost them twice as much to build. It's more profit for them.
These 0% 7 year loans are not coming from banks. They're coming from the car companies. They're a sales tool.
The dealerships are making their money with various add-on packages now, to try to bump up the sale price. It isn't even in your favour to offer cash in most cases.
something is very wrong with the lending market when it makes sense to give people free money.