Retailer who offers one of those 0% financing schemes, here. TL;DR: It's from processing fees paid by the retailer and punitive interest after the 0% promotional period lapses.
The lender makes money in two ways. One, a percentage fee is charged on the financed amount, but it's not paid by the customer. It's paid by the retailer. For us it is a little under 2%, similar to the fees most credit card processors charge. So as soon as you make your purchase, the bank instantly skims 1-point-whatever percent off the top. You don't see this, though. It affects the retailer's bottom line, not yours.
Two, the 0% interest rate is a promotion which provides specified limited time in which to pay off the balance. If you do not pay the outstanding balance in full by the end of the promotional term, the bank whacks you for a monstrous interest rate on the entire original transaction amount -- not just the remaining outstanding balance. In our case this is damn near 30%. Look carefully at the promotional signage and literature. It will always say "0% INTEREST FINANCING!!! ~for~ ~12~ ~months.~" That 12 months is important. That's the end of the promotional terms, after which you pay aforementioned buttload of interest.
And then, the minimum payments on the bills they send you are obviously deliberately structured to trick you into failing to pay the entirety of the balance by the deadline at the end of the promotional period.
If you're talking 0% introductory rates for general purpose credit cards, the answer is right there in the name. Those are introductory rates designed to entice you into signing up and using the card, but they're never permanent. Eventually that introductory rate will expire and you will be left with an interest bearing credit card. Possibly a lot of interest. Even if you pay your bill 100% on time every month without fail, the bank still makes money in percentages and processing fees taken on every transaction from every single retailer where you've swiped that card. The bank issuing the credit card can continue to comfortably make money even if no one pays any interest, ever.