Plants make sugars by means of photosynthesis. Through this process, they take the energy of the sun and combine it with water and carbon dioxide and convert it to glucose. The waste product of this conversion is oxygen.
Chlorophyll is the green substance in a plant's leaves. This chemical absorbs sunlight and uses its energy to fuel the conversion of chemicals in photosynthesis.
Carbon dioxide enters plants through their leaves. Tiny holes called stomata regulate gas flow into and out of a plant. Plants use the carbon molecule to create glucose.
Water, absorbed by a plant's roots and, to a lesser extent, made in its leaves, contains hydrogen and oxygen. Plants also use hydrogen to create glucose.
Glucose also contains oxygen, and plants convert some of the available oxygen molecules into sugar. Excess or waste oxygen is released through the leaves via the stomata.
The released oxygen becomes a vital part of the air that animals, including humans, breathe. We return the favor by exhaling carbon dioxide for plants to absorb so that the cycle continues.