Plants, algae, and some bacteria capture energy from sunlight to produce oxygen (O2) and chemical energy stored in glucose (a sugar). During photosynthesis, plants take in carbon dioxide (CO2) and water (H2O) from the air and soil. Within the plant cell, the water is oxidizing, meaning it loses electrons, while the carbon dioxide is reduced, meaning it gains electrons. This transforms the water into oxygen and the carbon dioxide into glucose. The plant then releases the oxygen back into the air and stores energy with the glucose molecules.