Barley is soaked in water until the grain sprouts, which releases enzymes in the grain that convert starches to sugars. The barley is then heated and dried (that's the "malting") to stop the germination before the seed starts consuming the sugar. Like coffee beans, this subtle roasting of the grain can produce either lighter color and flavors or darker, more intense flavors that affect the final brew.
This process also softens the barley and makes it easier to extract the sugars, as well as releasing enzymes that can affect the beer's flavor during fermentation. Beer can contain other grains in addition to barley — most often wheat, but also oats and rye — which may be malted or not, depending on local custom and laws. Grains like sorghum, maize and rice are cooked instead of malted to release the sugars.
The malted barley is then cracked and ground, turning it into grist and readying it for the mash tun. There, hot water is mixed with the malt — usually for an hour or two — to convert complex starches into simpler glucose sugars and draw them from the grain, thanks to a couple of enzymes created during malting. Water is drained off the bottom and poured back over the top (called lautering) to keep liquid moving through the husks of the barley.
The resulting sweet water is wort, the base liquid of beer. Some brewers repeat the process on a single batch of grain, depending on the hardness of the barley, bringing the mash to a boil several times over a long period.
The wort is transferred into the brew kettle and boiled. This will kill any remaining enzymes and removes some of the water to increase the sugar content of the liquid. It's also when hops are added, either in the beginning of the brewing — which can impart bitter and drying notes — or nearer the end for more fragrant aromas. Hops can also be added while the beer is maturing or even when the beer is aging in cask; this is called dry-hopping.
Solids are removed from the liquid, and the hopped wort is quickly cooled and moved to a refrigerated tank. Then comes the yeast, which works its glorious magic by converting sugar into alcohol and carbon dioxide. Punch and fizz, all thanks to tiny living organisms. Ales ferment quickly — just a couple of weeks at near room temperature. Lagers take time and energy — six weeks or so at around 50 degrees. That temperature must be watched, since the yeast's hard work gives off a lot of heat. Gas is vented from the otherwise sealed tank through a one-way valve; once the fermentation is almost over, that vent is sealed and the beer begins to build serious carbonation under pressure.
When the beer is done fermenting, it is chilled and moved to another tank, leaving the yeast and sediment behind. More carbonation can be added at this point, and then the beer is pumped into sanitized kegs or bottles, with great care taken to avoid excessive contact with the air. Contaminants in the air or unclean materials can introduce wild yeast into the brew that will start fermentation again and make for nasty drinking.
Pop! Fizz. Aaahhh. Refreshing.