I think I know what you're asking about. One region is n-doped, with fixed positive charges and free electrons. Near it there's a p-doped region, with fixed negative charges and free holes. In between there's a depletion region with no fixed charges and very low electron-hole concentrations.
I guess you're asking why electrons don't just wander from the n region into the depletion region. If a very small number do, that leaves behind a net positive charge on the n region, which holds the other electrons in via the electrostatic potential. The same argument works, with opposite sign, to explain how the p region holds on to almost all its holes.
The electrons and holes that do make it into the depletion region for the most part annihilate, leaving only the very low intrinsic thermodynamic equilibrium concentration of electrons and holes.
If an external voltage is applied, current can flow easily in the direction which brings electrons in from n and holes in from p, to annihilate in the middle. In the opposite direction which is essentially trying to pull holes and electrons out of the depletion region, the rate at which they spontaneously form is so low that very little current flows.
Maybe that answered your question.
(published on 04/30/10)