The monks have always known exactly how to get around inconvenient rules. In the Middle Ages, even during fasting, they did not deny themselves beer.
If we compare today's realities with those of the Middle Ages a bit loftily, the role of today's corporations producing beer on a mass scale was played, especially at the beginning of the era, by monasteries. It was they who, using the privileges granted to them, brewed beer and even settled accounts with it (possibly with hops). With time, this beloved beer, irrespective of the historical period, started to be brewed by royal courts and more and more independent city breweries were established (many of them survived until modern times).
An interesting approach to beer was represented by medieval clerics, famous (not only) at that time for their debauchery. According to Wikipedia, at the abbey of Le Bec, for example, monks were allowed to drink beer as needed (ad necessitatem), but in moderation (ad voluptatem). According to the rule that drink does not break the fast, beer could be consumed even on Good Friday (as the only meal).
By the way, monasteries made a lot of money on beer. Thanks to accumulated funds and monopolized access to knowledge, the clergy could develop brewing according to their own needs. This is when beer was first aged in barrels and clarified with wood chips. Kilns were also in use, helping to dry malt, among other things. Oh, and one more thing. Monastery brewers were eager to use hops. Thanks to them, it began to be considered an important ingredient in beer because of its health, taste and preservative qualities.
The monastery's monopoly was finally put to an end, which had a positive effect on the quality of beer brewed in the Middle Ages. But more about that in the next episode.