Photosynthesis occurs in the chloroplasts of plant cells, which contain stacks of thylakoids where the light-dependent and light-independent reactions take place. Light energy is absorbed by pigments like chlorophyll and carotenoids in the thylakoids, causing electrons to be transferred between photosystems and pumped across the membrane, generating a proton gradient used by ATP synthase to make ATP and ultimately sugars from carbon dioxide in the Calvin cycle.