Carbon dioxide, present in the air, enters the leaves by "diffusion" through the stomata - pores. The amount of carbon dioxide available can fall when planting is dense, when plants have been rapidly photosynthesising, or in unventilated greenhouses, so growers can artificially supply it by burning propane gas or releasing pure carbon dioxide, in greenhouses or poly tunnels.
Eventually carbon dioxide is again released as a by product of photosynthesis, thus completing the circle.