This can be explained by analyzing the two chemical equations
The equation for photosynthesis is:
6CO2+6H20--->C6H12O6+6O2
The equation for aerobic respiration is:
C6H12O6+6O2--->6CO2+6H2O
The oxygen that is produced by the photosynthesis is consumed by the organism that do aerobic respiration.