Photosynthesis is the process by which plants, algae, and cyanobacteria use sunlight, water, and carbon dioxide to produce oxygen and energy in the form of ATP and NADPH. It occurs in two stages - the light-dependent reactions and the light-independent reactions. The light-dependent reactions use energy from sunlight to produce ATP and NADPH using a process called the Z-scheme that involves two photosystems. The light-independent reactions then use these products to incorporate carbon from carbon dioxide into organic compounds like glucose.