Photosynthesis can be divided into two processes: the light reaction and carbon fixation.
Light reaction:
During the interaction with a photon, the electron gains energy and is raised to a higher potential energy level. This process is called excitation. However, an excited electron is unstable, and it will return to its ground state again. The loss in potential energy appears as heat and light. This process is called fluorescence. In chlorophyll, since it is normally embedded in the photosynthetic membrane, it will not undergo fluorescence but the excited electron is captured by a primary electron acceptor in the photosystem.
Photosystem:(linear electron flow)
The thylakoid membrane is populated by two types of photosystems called photosystem II (P680) and photosystem I (P700). A photosystem consists of two parts: antenna complex and reaction center. An antenna pigments absorbs a photon and transfers its electrons from pigment to pigment until it reached a chlorophyll a molecule in an area called the reaction center. An enzyme (Z protein) catalyzes the splitting of water molecule into two electrons, two H+ and an oxygen atom. These electrons can replace the electrons transferred to the primary electron acceptor. The H+ are released into the thylakoid lumen. The oxygen atom combines with an oxygen atom generated by the splitting of another water molecule and forms water. The electrons pass to PS I from PS II through an electron transport chain, which consists of Pq, Cytochrome complex, and Pc. It is exergonic so ATP is synthesized. H+ is pumped into the thylakoid lumen by the energy provided, and contributing to the proton gradient for chemiosmosis. The electrons then enter the PS II and experience the same process in PS I. This also requires the light. The enzyme NADP+ reductase catalyzed the transfer of e- to NADP+, and forms NADPH. This molecule has a higher energy than water; therefore it acts as the final e- acceptor in the noncyclic ETC.
H2O (by Z protein) → PS II → PQ → b6-f complex → PS I → Fd →NADP reductase
There is also a cyclic ETC, which only occurs in PS I not PS II. The electrons cycle back from Fd to the cytochrome complex and from there continue on to a P700 chlorophyll in the PS I reaction center complex. However, it only generates ATP but not NADPH.
The potential energy stored in the form of an H+ gradient allows the protons to cross the membrane and produce ATP from ADP. Unlike mitochondria, chloroplasts do not need food energy but transform light energy into chemical energy. In chloroplast, ATP is synthesized as H+ is diffused from thylakoid space back to the stroma though ATP synthase complexes. Therefore, ATP is generated in the stroma.
In conclusion, thylakoid membrane converts light energy to chemical energy stored in ATP and NADPH. Oxygen is a by-product.