During photosynthesis, plants take in carbon dioxide (CO2) and water (H2O) from the air and soil. Inside the plant cell, the water is oxygenated, which means it loses electrons, while the carbon dioxide is reduced, which means it gains electrons. This converts the water into oxygen and the carbon dioxide into glucose.