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 glucose. It occurs in two stages - the light-dependent reaction which converts solar energy to chemical energy in the form of ATP and NADPH, and the light-independent reaction which uses this chemical energy to fix carbon and produce glucose. Photosynthesis is essential as it produces oxygen and glucose, the primary energy source for nearly all life on Earth.