Photosystem II is associated with oxygen-evolving complex - that has 4 Mg ions, one calcium ion and one chlorine ion - that splits water molecules to 4H+ and O2. Hence photosystem II obtain electron by splitting of water.
Photosystem I gets an electron from photosystem II. This Z-scheme is also called cyclic photophosphorylation.