From How To Brew
The yeast have eaten most all of the easily fermentable sugars and now start to turn their attention elsewhere. The yeast start to work on the heavier sugars like maltotriose. Also, the yeast clean up some of the byproducts they produced during the fast-paced primary phase....
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....
Leaving an ale beer in the primary fermentor for a total of 2-3 weeks...will provide time for the conditioning reactions and improve the beer. This extra time will also let more sediment settle out before bottling, resulting in a clearer beer and easier pouring. And, three weeks in the primary fermentor is usually not enough time for off-flavors to occur.