Answer:
Photosynthesis defined as the process by which plants make there own food by trapping sunlight and using carbon-dioxide and water to produce glucose as energy.
During photosynthesis oxygen is formed as raw material along with glucose after utilizing carbon-dioxide and water.
Photosynthesis process take place in two stages light-dependent and light-independent process. During the light-dependent reactions, water molecule releases an electron and oxygen and hydrogen atoms gets free. The free oxygen atom combines with another free oxygen atom and forms diatomic oxygen (O2) that released to atmosphere.
This is how oxygen enters the plants with the help of water molecules.