The cell uses respiration to convert glucose into energy and some of the electrons that passes through out this process are the ones that enter into the electron chain reaction.
Now, in photosynthesis yo convert CO2 into carbohydrates/organic compounds and O2