Here's how it works:
1. Light energy is captured by chlorophyll in the thylakoid membranes of chloroplasts.
2. This energy is used to split water molecules (photolysis), releasing electrons and protons.
3. The electrons are passed through an electron transport chain generating energy.
4. This energy is used to pump protons into the thylakoid lumen, creating a proton gradient.
5. The proton gradient drives ATP synthase, which uses the potential energy to synthesize ATP from ADP and inorganic phosphate.
In summary, ATP is produced as a result of light energy being captured and used to create a proton gradient. This ATP is then used in the Calvin cycle, the light-independent reactions of photosynthesis, to convert carbon dioxide into sugar.