Roasting coffee transforms the chemical and physical properties of green coffee beans into roasted coffee products. The roasting process is what produces the characteristic flavor of coffee by causing the green coffee beans to expand and to change in color, taste, smell, and density. Unroasted beans contain similar acids, protein, and caffeine as those that have been roasted, but lack the taste. It takes heat to speed up the Maillard and other chemical reactions that develop and enhance the flavor.
As green coffee is more stable than roasted, the roasting process tends to take place close to where it will be consumed. This reduces the time that roasted coffee spends in distribution, helping to maximize its shelf life. The vast majority of coffee is roasted commercially on a large scale, but some coffee drinkers roast coffee themselves in order to have more control over the freshness and flavor profile of the beans.