Suppose that a junction has just been formed. At that instant, holes are still in the P-region and electrons in the N-region. However, there is greater concentration of holes in P-region than in N region (where they exist as minority carriers). Similarly, concentration of electrons is greater in N-region than in P-region (where they exist as minority carriers). This concentration differences establishes density gradient across the junction resulting in carrier diffusion. Holes diffuse from P to N-region and electrons from N-to P-region and terminate their existence by recombination.

It might seem from above that eventually all the holes from the P-side would diffuse to the N side and all the electrons from the N-side would diffuse to the P-side but this does not occur due to the formation of ions on the two sides of the junction. The impurity atoms which provide these migratory electrons and holes are left behind in an ionized state bearing a charge which is opposite to that of the departed carrier. Also, these impurity ions, just like germanium atoms, are fixed in their positions in the crystal lattice in the P- and N- regions of the diode, they form parallel rows or ‘plates’ of opposite charges facing each other across the depletion layer.

Obviously, row of fixed positive ions in the N-region is produced by the migration of electrons from the N- to P- region. Similarly, the row of fixed negative ions in the P-region is produced by the migration of holes from the P- to N-region.
If a majority carrier (either an electron or a hole) tries to cross into depletion layer, it can meet either of the following two facts:-
- Either it can be trapped or captured by the row of fixed impurity ions of opposite sign which guard its own region. For example, a hole trying to approach the depletion layer may be neutralized by the row of fixed negative ions situated in the P-region itself at the edge of the depletion layer. So will be the case with the electron trying to approach the depletion layer from N-region.
- It may succeed in entering the depletion layer where it will be repelled by the row of similarly-charged impurity ions guarding the other region. But its life will be cut short by recombination with a majority carrier of opposite sign which has similarly entered the depletion layer from the other half of the diode.
Ultimately, an equilibrium condition is reached when depletion layer has widened to such an extent that no electrons or holes can cross the P-N junction.