Photosynthesis is the process by which plants, algae, and some bacteria use sunlight, water and carbon dioxide to produce glucose and oxygen. It occurs in two stages - the light-dependent reaction which uses sunlight to produce ATP and NADPH through the electron transport chain in the chloroplast, and the light-independent reaction (Calvin cycle) which uses the ATP and NADPH to incorporate carbon from carbon dioxide into organic compounds to produce glucose. Photosynthesis is essential for life on Earth as it provides the oxygen needed for respiration and removes carbon dioxide from the atmosphere.