The alkaline hydrogen evolution reaction (HER) is intricately linked to the water dissociation kinetics. The quest for new strategies to accelerate this step is a pivotal aspect of enhancing the HER performance. Herein, we designed and synthesized a heterogeneous nickel phosphide/cobalt phosphide nanowire array grown on nickel foam (Ni2P/CoP/NF) to form a p–n junction structure. The built-in electric field (BEF) in the p–n junction optimizes the binding ability of hydrogen and hydroxyl intermediates, efficiently promoting water dissociation for the alkaline HER. Consequently, Ni2P/CoP/NF exhibits a lower overpotential of 58 and 118 mV at 30 and 100 mA cm–2, respectively, and high stability over 40 h at 300 mA cm–2 for the HER in 1 M KOH. Computational calculations combined with experiment results testify that the BEF presence in the p–n junction of Ni2P/CoP/NF effectively promotes water dissociation, regulates intermediate adsorption/desorption, and boosts electron transport. This study presents a rational design approach for high-performance heterogeneous electrocatalysts.