It would make sense to talk about yeast next. The yeast is going to convert the sugar from the malt into alcohol by fermentation. Fermentation is an anaerobic process, which means it occurs in the absence of oxygen. Yeasts are single cell organisms from the kingdom Fungi. There are two main species of yeasts used in brewing. Ale yeasts are usually strains of the species Saccharomyces cerevisiae, while lager yeasts are Saccharomyces pastorianus.
Ale yeasts are 'top-fermenting' yeasts, and prefer warmer temperatures, while lager yeasts are 'bottom-fermenting' yeasts and prefer cooler temperatures. There are many different strains of yeast, each of which is typically used to brew a particular style of beer. The strain of yeast used contributes a lot to the overall flavor of the final product. There are several large commercial yeast labs that produce their version of all the major strains of yeast and label them with the style of beer they are traditionally used for.
How does the yeast contribute so much to the flavor profile? Well, the yeast is a living organism, so as well as doing the heavy lifting of converting sugar to alcohol there are a variety of other reactions occurring that add to the flavor and mouth feel of the beverage. There are also other, simpler reasons. For example we need to consider the attenuation of the yeast. That is a measure of how completely the yeast uses up the available sugar. No yeast converts 100% of the available sugar and the remaining sweetness is a big part of the style of the beer (in the same way that wines are classified by being sweet or dry).
One big class of chemical compounds produced by yeasts is the esters. Esters are notorious as flavoring chemicals, as they have characteristically fruity odors. Most chemistry students will at some point be introduces to isoamyl acetate, the chemical used to flavor pear drops. In the brewing world, perhaps the most famous esters are those that give banana flavors to many belgian styles, but there are many beers that benefit from different fruity notes. The same belgian style yeasts that produce banana flavors also tend to produce phenols, which can be perceived as a clove-like flavor. Another common by-product is diacetyl, which tastes like butterscotch. Generally this is considered a bad flavor in beer, but can be a part of certain styles.
Understanding all these side reactions is a big part to understanding the brewing process. At first it is easy to wonder why the beer isn't finished after a week. The fermentation is usually complete by then, but it can take several more weeks under particular conditions for some of the other characteristics of the beer to develop.