Update: based on a discussion in the comments (thanks to stannius
and OP for providing evidence), we've determined that this is specific to the Discover credit card for a promotion called Cash at Checkout. A summary of the details are:
- When completing your transaction you will be presented with a cashback option, only if you pay with your Discover card, and only if shopping at one of approximately 70 specific stores.
- The charge appears on your bill as a single charge from the store, as if you spent that much at the store. You are not charged a cash advance fee or interest rate like you would be if you used your credit card to withdraw cash from an ATM.
- You can take out a maximum of $120 per 24 hours, though stores may impose a lower limit if they want to.
Note it's possible, though IMHO unlikely, that you can still actually get the 5% cash back bonus rate when combined with the "Cash at Checkout" feature. Based on the terms (described below), it appears that portion of the transaction is excluded. The fact that this offer only happens with a Discover card and at specific stores, suggests that Discover could very easily know exactly how much of the transaction was cash back and could treat it differently, if they choose to. The terms and conditions of the 5% offer states (emphasis mine):
You will not earn Cashback Bonus on cash advances, portion of purchases paid
with rewards, balance transfers, transfers from Discover® checking or other deposit
accounts, illegal transactions or on any cash you receive in connection with a
purchase at the point of sale through our Cash at Checkout feature.
My interpretation of that, and specifically the word "Bonus" means Discover does know, and instead you likely will only earn the normal 1% rate. (I suppose it's possible that it's even 0%, which would be fair if Discover also didn't charge the store the normal 2%-ish for that portion of the transaction).
Note the 5% promotion is time limited and has a cap on $1500 in purchases, so even if the 5% applies your arbitrage scenario would be capped at $75, and beyond that if the 1% applies it would be capped at approximately $36/month if you took out $120 per day. (And perhaps these numbers are doubled by the promotional cashback match for new customers in the first year.)
I think it's also worth mentioning that if you are using your card for this sort of arbitrage scheme, they could potentially shut it down for you. Their terms state:
We reserve the right to disqualify customers from earning rewards in the event
of fraud, abuse of program privileges or violation of the Terms as determined by
the sole judgment of Discover. Abuse of the rewards program includes, but is not
limited to, repeatedly opening or maintaining account(s) solely for the purpose of
generating Rewards or solely for the purpose of purchasing gift cards.
That seems to be more targeted to opening multiple accounts though; I doubt Discover would care too much about one person going to the store every day to take out $120. The store might care more than Discover does...
Original Answer: Note this portion of the answer still applies, in the rare occurrence when some stores increase the charge amount and provide cash back, or if you manage to still receive 5% cashback on the entire transaction with the Discover promotion:
Where is my $2.47 free money from?
Note, actually, your gain is the full $2.50 because you also got a garbage bag, which is presumably worth 3 cents. 🙃
A high volume store will pay, on average, about 2% of transactions in credit card processing fees, so about $1 of your gain came from the store. The other $1.50 came from the bank as an incentive to use the card. You can safely assume, that anytime a credit card offers more than about 2% cash back, either generally, or for specific categories, that this is an expense the bank is willing to pay to keep you as a customer. Think of it as a marketing and/or customer retention expense.
Side Note: it's somewhat rare for stores to add cashback to a credit card purchase for this very reason. Presumably the store knows this though, and since most people would come into the store and buy other stuff too, they can allow it across the board without too big of a hit to their bottom line.