Excessive carbon dioxide (CO2) emissions by combustion of fossil fuels are linked to global warming and rapid climate change. One promising route to lowering the concentration of CO2 in the atmosphere is to reduce it to useful small molecules via photoelectrocatalytic hydrogenation, which would enable solar energy storage with a zero-carbon emission cycle and perform a more efficient separation of the photogenerated electron and hole pair than pure photocatalysis. Indeed, photoelectrocatalytic CO2 reduction has been an intense focus of research. Using the density functional theory (DFT), we studied the CO2 reduction reaction on the defective anatase TiO2 (101) surface, at both the solvent/catalyst and the electrolyte/catalyst interfaces. The analysis of the electronic structure of the surface shows a contrast between the solvent/catalyst and the electrolyte/catalyst interfaces, which results in the two corresponding catalytic cycles being distinct. Our study explains at the electronic and mechanistic levels why methanol is the main product in the presence of the electrolyte and why the overpotential is not only controlled by the reaction process but also by the diffusion process.