Photosynthesis is the process by which plants, algae, and some bacteria use sunlight, carbon dioxide, and water to produce oxygen and energy in the form of glucose. It occurs in the chloroplasts of plant cells and involves two stages - the light dependent reaction where ATP and NADPH are produced, and the light independent Calvin cycle where glucose is produced. Chlorophyll and other pigments absorb sunlight which is used to drive these reactions that ultimately convert carbon dioxide into organic compounds.