People would set up accounts at their local stores so all their common daily and weekly errands could be done without cash. Then once a month (after payday) they would take cash around to all the local stores paying their accounts. (Or write a check, I guess)
Stores supported this because it was a form of lock-in, and because it reduced friction. Faster than exchanging cash too, or writing a check.
When working correctly (the customer comes in and pays without prompting) it's super low effort. Especially for stores with only one location and checkout counter. Only really costs time and money when a customer requires chasing up.