In a heterojunction, the difference in electron affinity and ionization potential of the two semiconductors creates an internal electric field at the interface. This field drives the separation of electron-hole pairs, with electrons migrating to one semiconductor and holes to the other. This efficient charge separation minimizes recombination losses and enhances the overall catalytic efficiency.