Comparison of photosynthesis and oxidative phosphorylation. The light-induced electron transfer in photosynthesis drives protons into the thylakoid lumen. The excess protons flow out of the lumen through ATP synthase to generate ATP in the stroma. In oxidative phosphorylation, electron flow down the electron-transport chain pumps protons out of the mitochondrial matrix. Excess protons from the intermembrane space flow into the matrix through ATP synthase to generate ATP in the matrix.