Plants produce oxygen and carbohydrates from carbon dioxide and water through the process of photosynthesis. Sunlight reacts with chlorophyll in the plant's leaves, and the plant stores that energy in the chemical bonds of carbohydrates. Oxygen is released into the atmosphere as part of the plant's respiration cycle.
In addition to carbohydrates, some plants are able to synthesize proteins and fats as well. This occurs when the plant takes nitrogen in from the soil, breaking it down into nitrates. These building blocks can then form lipids and amino acids, which is where beans get their protein and avocados get their fats. Plant proteins are often incomplete, however, which means they are lacking some of the 22 amino acids necessary to sustain human life.
Another important substance produced by plants is cellulose, a complex carbohydrate that makes up the structure of many plants. Cellulose is too complex for the human digestive system to fully break down, but some animals possess the bacteria and enzymes necessary to do so. In edible plants, the small amounts of cellulose make up part of dietary fiber, an indigestible material that helps maintain regularity in the digestive system. Cellulose also makes up wood, cotton and other inedible materials from plants that still may be valuable for certain applications.