Photosynthesis and cellular respiration are complementary processes and generate raw material for each other.
During, photosynthesis, plants utilize solar energy to form ATP molecules. They then take water molecules and carbon dioxide from the atmosphere and generate oxygen and glucose. During cellular respiration the oxygen and glucose are utilized as the raw materials and ATP molecules (energy) are generated along with carbon dioxide and water. Thus these processes form a cycle, where each process consumes the products generated by the other process.
In terms of chemical reactions:
Photosynthesis: CO2 + H2O + solar energy --> O2 + glucose
Respiration: Glucose + O2 --> CO2 + H2O + energy
(other sugars, apart from glucose, may also be generated and used in the respiration).
These processes maintain the levels of oxygen and carbon dioxide in the atmosphere by generating and consuming these gases. Plants generate oxygen for living organisms, who in turn, generate carbon dioxide that plants consume. Thus a balance is maintained.
However, due to deforestation, especially in underdeveloped countries, one part of this cycle gets damaged. That is, plants are absent and hence there is less oxygen production and less carbon dioxide capture. This increases the level of carbon dioxide in the atmosphere and reduces the oxygen content.
Hope this helps.