Photosynthesis is the series of reactions plants use to manufacture sugars from atmospheric carbon dioxide. There are two distinct phases to photosynthesis: the light reactions and the dark reactions. Water plays an important role in the light reactions.
When a photon of light strikes a molecule of a pigment called chlorophyll and is absorbed by an electron, the electron gains energy and jumps to a higher orbital for an instant before falling back to its original orbital, transferring energy to another molecule of chlorophyll in the process. The light energy is relayed through a series of chlorophylls in this fashion until it reaches a special pair of chlorophylls called P680. The excited electron in P680 is transferred to another molecule called the primary acceptor, leaving P680 with a positive charge.
At this point, water takes center stage. An enzyme (a protein that catalyzes reactions) that can split water transfers electrons to P680 by taking them from a water molecule. By breaking up two molecules of H2O, this enzyme releases oxygen gas (O2) and four hydrogen ions. All the oxygen that you breathe was formed through this process.
Essentially, water's role in photosynthesis is as an electron donor to replace the electron lost by P680. The high-energy electron, meanwhile, is transferred to an electron transport chain, where it will help drive a series of events that power the synthesis of a molecule called ATP. Through this process, the plant cell will take light and store it in the form of chemical energy.