In PSII, there is an enzyme that, in the presence of light, splits water molecules into protons (hydrogen ions), electrons + oxygen
some of the oxygen produced during photolysis is used by plant cells for aerobic respiration, but during periods of high light intensity the rate of photosynthesis is greater than rate of respiration in plant, so much of the oxygen by-product will diffuse out of the leaves, through stomata, into surrounding atmosphere