The primary function of G6PD is to catalyze the first step of the pentose phosphate pathway, converting glucose-6-phosphate into 6-phosphoglucono-δ-lactone while reducing NADP+ to NADPH. NADPH produced in this reaction is vital for anabolic reactions and for maintaining the reducing environment of the cell by regenerating reduced glutathione (GSH).