Beer (or any other alcohol in general) might be invented by accident
Then it's discovered to preserve some food, use to disinfect, used for rituals because it alters the mind and at times, safer to drink than water (when time where we don't know shit about germs and how alcohol and boiling kills them)
Then we somehow evolve to like the damn thing.