Later in the Earth's history, primitive plants and algae began to grow in the oceans and on land. They carried out photosynthesis, which uses carbon dioxide and water and makes glucose and oxygen.
The word equation is: carbon dioxide + water → glucose + oxygen. Photosynthesis needs light energy. The balanced symbol equation is 6CO2 + 6H2O → C6H12O6 + 6O2.
As plants grew in number, they removed more carbon dioxide from the atmosphere, so the amount of carbon dioxide decreased. They also released oxygen, so over a very long time the amount of oxygen in the atmosphere gradually increased until it reached the level in today's air.