Zachary Crockett at the Hustle has a nice description of the economics of owning and operating vending machines. It is a fascinating look at an industry I would never have known about otherwise.
There are about 2 million in operation in the US generating $7.4 billion in annual revenue for nearly 18,000 businesses that own them. Most owners run small operations as sole proprietors but Coke and Pepsi have vertically integrated into owning their own machines. The business scales well which allows for a gig workers type of entrepreneurship.
Owners rent space for their machines mostly in manufacturing plants, offices, hotels, and hospitals and typically pay a percentage of gross revenue. The biggest decisions are what to stock and where to locate them.