Anthropologists believe that humans stumbled upon alcoholic beverages by accident; perhaps a piece of fruit had fermented when it was eaten or a bit of grain had grown soggy and begun producing alcoholic sugars. By some incredible stroke, we stumbled upon liquor and even more amazing, we figured out how to make our own.
As far as the Sumerian civilization was concerned, they had help in the form of inspiration from Ninkasi, the goddess of beer. The Sumerians weren't necessarily the first to make beer -- 9,000-year-old shards of pottery from China show traces of it -- but the Sumerians were among the Mesopotamian groups to devise a system of writing and one of the things they wrote was a hymn to Ninkasi. This 3,800-year-old hymn, an ode to the goddess' gift, includes a recipe for making beer woven in its prose [source: Civil].
Ninkasi also used her talents for the other gods, serving as head brewer to the Sumerian pantheon.