They have to sell it to retailers for less than they'd get after credit card acceptance. E.g. Apple sells gift cards for $88/$100 to a retailer, who then uses the remaining $12 on transaction costs (including paying their credit card fees) and profit margin.
Vs. Apple likely loses ~2% on credit card acceptance-- and gets to keep $98/$100.
It's still worth it, because they capture money from last-minute gifts, etc...