When we connect P and N materials, electrons from N drift to P, thus create negative ions in P and positive ions in N.
=> electric field (barrier potential) must depend on an amount of electrons recombined with holes in P region.
=> The more electrons recombined, the more ions created, the...