Photosynthesis produces glucose using energy from sunlight. The total amount of glucose produced in photosynthesis is called Gross Primary Productivity (GPP).
Some of this glucose is used for respiration, to produce ATP. ATP is used to help enzymes catalyze metabolic reactions in the cell.
The rest of the glucose is available for plant growth (ie. synthesis of polymers like cellulose & lignin). This portion of glucose is called Net Primary Productivity (NPP).
GPP = NPP + Respiration (+ heat lost)
Both Photosynthesis and Respiration proceed via a common intermediate – Triose Phosphate (TP).
In photosynthesis, CO2 is converted to TP, which is then used to make glucose (trapping carbon).
In respiration, glucose is broken down to TP, which in turn enters the Krebs cycle via Pyruvate, releasing ATP (respiring carbon).