What to keep in mind is, that during the middle ages, alcoholic drinks were pretty much the main beverage.
Before public sanitation, cholera and other water-transmitted diseases
were a significant cause of death. Because the process of brewing any
beer from malt involves mashing and boiling which effectively
pasteurizes the wort, and the fermentation and hops protect against
infection, drinking small beer instead of water was one way to escape
infection. It was not uncommon for workers (including sailors) who
engaged in heavy physical labor to drink more than 10 Imperial pints
(5.7 liters) of small beer during a workday to slake their thirst.
(Wikipedia on "Small Beer", a lightly alcoholic beverage)
To quote from an article by Malcom Gladwell
What this flood of caffeine did, according to Weinberg and Bealer, was to abet the process of industrialization–to help “large numbers of people to coordinate their work schedules by giving them the energy to start work at a given time and continue it as long as necessary.” Until the eighteenth century, it must be remembered, many Westerners drank beer almost continuously, even beginning their day with something called “beer soup.” (Bealer and Weinberg helpfully provide the following eighteenth-century German recipe: “Heat the beer in a saucepan; in a separate small pot beat a couple of eggs. Add a chunk of butter to the hot beer. Stir in some cool beer to cool it, then pour over the eggs. Add a bit of salt, and finally mix all the ingredients together, whisking it well to keep it from curdling.”) Now they began each day with a strong cup of coffee. One way to explain the industrial revolution is as the inevitable consequence of a world where people suddenly preferred being jittery to being drunk. In the modern world, there was no other way to keep up. That’s what Edison meant when he said that genius was ninety-nine per cent perspiration and one per cent inspiration. In the old paradigm, working with your mind had been associated with leisure. It was only the poor who worked hard. (The quintessential pre-industrial narrative of inspiration belonged to Archimedes, who made his discovery, let’s not forget, while taking a bath.) But Edison was saying that the old class distinctions no longer held true–that in the industrialized world there was as much toil associated with the life of the mind as there had once been with the travails of the body.