The fermentation of malt sugars into beer is a complicated biochemical process. It is more than just the conversion of sugar to alcohol, which can be regarded as the primary activity. Total fermentation is better defined as three phases, the Adaptation or Lagtime phase, the Primary or Attenuative phase and a Secondary or Conditioning phase. The yeast do not end Phase 2 before beginning Phase 3, the processes occur in parallel, but the conditioning processes occur more slowly. As the majority of simple sugars are consumed, more and more of the yeast will transition to eating the larger, more complex sugars and early yeast by-products. This is why beer (and wine) improves with age to a degree, as long as they are on the yeast. Beer that has been filtered or pasteurized will not benefit from aging.
The conditioning process is a function of the yeast. The vigorous, primary stage is over, the majority of the wort sugars have been converted to alcohol, and a lot of the yeast are going dormant; but there is still yeast activity. During the earlier phases, many different compounds were produced by the yeast in addition to ethanol and CO2, e.g., acetaldehyde, esters, amino acids, ketones- diacetyl, pentanedione, dimethyl sulfide, etc. Once the easy food is gone, the yeast start re-processing these by-products. Diacetyl and pentanedione are two ketones that have buttery and honey-like flavors. These compounds are considered flaws when present in large amounts and can cause flavor stability problems during storage. Acetaldehyde is an aldehyde that has a pronounced green apple smell and taste. It is an intermediate compound in the production of ethanol. The yeast reduce these compounds during the later stages of fermentation.
The yeast also produce an array of fusel alcohols during primary fermentation in addition to ethanol. Fusels are higher molecular weight alcohols that often give harsh solvent-like tastes to beer. During secondary fermentation, the yeast convert these alcohols to more pleasant tasting fruity esters. Warmer temperatures encourage ester production.