Beer, ale, tea and coffee were the only trusted sources of potable water until about the last 25 years or so of the 19th century. And once the natural benefits of caffeine were applied to industry coffee and tea (and somewhat later, soft drinks like Coca Cola) were the only acceptable forms of workplace beverages. It was the busybody temperance women that gave us the fiasco that was prohibition.
(and somewhat later, soft drinks like Coca Cola)
******************************
And... the early Coca Cola contained cocaine extract, which quickly led to its popularity!