The accepted answer is complete insofar as the bank-as-originator goes. There is, however, an importantly not-a-scam situation that is common in certain sectors (energy efficiency home improvement being the one relevant to my field of work).
It is entirely possible that a given "0% loan" is not actually 0%, but rather the interest is being paid by a third party. These third parties may have made arrangements with the bank to let the bank market the loans as 0% in order to outsource customer acquisition.
These kinds of loans are used to promote public policy objectives (in my world it's to get people to install energy efficiency equipment that isn't within their own microeconomic benefit, but only marginally so - and there's societal benefits like GHG mitigation or reduction in air pollution if people do this work so society has a reason to foot some of the bill).
So the bank issues you a loan at 4.5% APR, but the subsidizing entity pays the interest part of your bill. The loan, to you, is effectively 0% interest, but the bank is still getting to collect interest. What's more, because it's a massive funding entity covering the interest payments the bank doesn't need to charge as high a rate as normal because default risk is also mitigated here.
Disclaimer: A number of scams will purport to be this kind of scheme. Always check the fine print and/or verify by contacting the third party directly if you smell anything fishy.