I doubt they are able to use that money without it showing up as a loan (oversimplification).
While they get $25 in cash, they also get $25 in obligation/debt to you (eg: they owe you $25 in products). If you don’t use it, after a jurisdiction dependent time, it goes to the jurisdictions treasury (at least in some areas). Or in other words they can’t count that $25 as money they have until you the use credit.
It’s probably more complicated than this as I’m not an accountant.
I know that typically with gift cards the dollars fall into a "deferred revenue" account until they are actually realized as a sale against a product/service tied to an income account. You can say "We have X amount in deferred revenue" but can't actually show it as recognized until certain things happen (VSOE rules for software, etc). In the case of Starbucks I think it would be similar, though I'm not sure if using their app for payment qualifies as a "gift card" in the same sense or not.
I believe there are also different laws in different states and jurisdictions related to "breakage", e.g. some states don't allow gift cards to expire whereas others do, so in the latter you can forecast breakage upon set dates whereas in the former it's a lot harder to do because you basically "owe" a product or service indefinitely.
PS I am not an accountant but I've worked with a lot of them via backend billing systems implementation and development.
While they get $25 in cash, they also get $25 in obligation/debt to you (eg: they owe you $25 in products). If you don’t use it, after a jurisdiction dependent time, it goes to the jurisdictions treasury (at least in some areas). Or in other words they can’t count that $25 as money they have until you the use credit.
It’s probably more complicated than this as I’m not an accountant.