If it's fungible to cash, it's a cash advance
That is, if it can be converted to same value cash easily.
Classic example: Walk into a casino and buy $5000 in poker chips on a credit card. Take the chips to a cashier and cash them out and have $5000 cash. Well, now you've just done a cash advance.
Classic counterexample: Walk into Taco Bell and buy a $20 Taco Bell gift card. That is not fungible to cash; Taco Bell won't give you $20 for it. It is only good for Taco Bell food. You could sell it for cash, but but you'd get less than $20 for it because the person would not trust you as much as they'd trust Taco Bell to give them a $20 gift card).
But a general purpose gift card, such as a Visa Gift Card, is again back to "cash-like" because you can buy almost anything with it that you can buy with cash.
This is enforced by the flow of money (service fees)
When you use a credit card at a merchant to buy goods, the merchant does not charge you a surcharge for using the credit card. However, they themselves pay fees of between 2 and 5 percent to the credit card clearinghouses. The merchant chalks this off as a cost of doing business, and has some advantages over cash which mitigate its cost. Indeed, many new merchants are going to credit card only.
However, when you buy something which is fungible to cash, the seller has a problem. If you buy $5000 in casino chips and immediately walk to the cashier and cash them out, what happens? The casino loses 2-4%. That won't do.
So the banks give the casino a way to do the transaction as a "cash advance". That way several things happen. You pay the transaction fees instead of the casino. It comes out of your "cash advance" credit limit on the card. And, the casino gets special protection in the event you attempt a "chargeback".
Companies which sell general use Visa or Mastercard gift cards do the same thing, because a Visa gift card is substantially fungible to cash (or Visa would certainly claim so!)
Now why doesn't Taco Bell do that? Well #1 Visa and Mastercard may not let them since the card is fungible for Chalupas, not cash lol. #2 it's bad customer relations. #3 they'd need to educate their staff to process it that way.