It's a few things, most likely. It removes human error (did you give the cashier a $1 or $100 bill?), reduces risk of loss/theft of physical assets, reduces staffing costs (One person can operate one manual till, one person can operate 15? automated tills where they're basically just overriding weights and checking ID for alcohol), is probably _cheaper_ than handling cash (because you already have a visa/mastercard/payment provider contract who will give you discounts for increased volume, and they likely charge less because of the topic of this article).
The interesting thing is, both of these store chains already had fully automated checkouts, they simply removed the ability for these to accept cash and make change.