This is a result of photosynthesis, the process where plants use sunlight, water, and carbon dioxide to create their own food (sugar) and release oxygen as a byproduct.