Well yes, beer was likely “invented” during the stone age when people left grains and stuff in the corner too long.
Monk kinda perfected it and made it a “thing” since around the 5th century. Some of the monastic breweries in Germany are over 1,000 years old.
It was the monks who noticed that one got ill less by drinking beer than local water.