Photosynthesis is the process by which plants, algae, and some bacteria use sunlight, water and carbon dioxide to produce oxygen and energy in the form of sugars like glucose. It involves two sets of reactions - light-dependent reactions which use energy from sunlight to make ATP and NADPH, and light-independent reactions known as the Calvin cycle where carbon from carbon dioxide is fixed into organic carbon compounds like glucose using energy from the ATP and NADPH produced in the light reactions. Some plants like cacti use CAM photosynthesis which helps them conserve water.