With a deal with an airline, the company doesn't have to do the 1-2% cashback, instead they give 0 to the customer. The airline company will give them miles though. Now the airline company can say to the credit card company: "look these thousands of customers you have them only thanks to me, so let's split your profits from the merchant 50/50 (or at least give me that 1% cashback you don't have to pay the customer), plus at some point I'll have to actually offer a plane ticket to those customers who earn enough miles"
What a customer gets usually is something like 7 miles per dollar. Consumer website estimate[1] that in the best of case, a mile is equal to ~$0.01, so they're also saving money there. (Plus the money the credit card company give them is today, whereas the plane ticket might be in one year or more, so the present discounted value of that ticket is even less)
[1] https://thepointsguy.com/2017/04/april-2017-monthly-valuatio...