Let's take a short look at photosynthesis before moving on to this topic.
It is an exergonic, light-dependent, biological, oxidoreductive, energy-yielding process. Where sugars or (CH2O)n are produced energetically by reducing CO2.
Although Co2 is essentially prevalent in nature, it does not break down into sugars since the reaction is thermodynamically possible.
Right after sunlight strikes the surface of the leaf, there are these little components known as reaction centers or energy harvesting cores, which are surrounded by antenna complexes. These antenna complexes are normally composed of chl a, chl b, xanthophyll, carotenoid, etc.
Here, the antenna complexes serve as filters, allowing just the necessary amount of flux to depart the outershelled electron of the chlorophyll molecule via energy activation states (of different kinds).
As the pigment system activates the chlorophyll molecule, the energy from the light is now transferred to chemo potential energy, which is subsequently employed in the process to oxidize the water molecule by the Kok clock mechanism.
Now this is an rather interesting cycle having multiple energy states, from Ground (SO) to maximum (S4) notice that the energy was first required to move on to next step in intermediates but as soon as it reached S4 or max state it oxidized water and this energy is actually enough to reduce Carbon di Oxide to sugar.
(Attachment #1)
If I'm not incorrect, the conversion works like this.
(Attachment #2)
As a result, it needs to be activated gradually in order to build up enough energy to pass the energy barrier.
NOTE:
As you can see, plants don't purposefully create oxygen, but why do they continue to do so? It does this because its primary goal is to turn sugar into oxygen, which it then converts into water that actually vaporizes while keeping the system cool.