Answer is: to convert solar energy into the chemical energy of sugars.
Solar energy is stored in chemical bonds of sugars (glucose for example).
In carbon dioxide, carbon has oxidation number +4 and in photosynthesis carbon gain electrons (solar energy), so
his oxidation number is lowered (reduced). Light energy is transformed
into chemical energy, that is stored in carbohydrate molecules
(glucose), which are synthesized from carbon
dioxide and water.