This process continues
until the diffusion current equals the drift current Thus a p-n
junction is formed In a p-n junction under equilibrium there
is no net current The loss of electrons from the n-region and the gain of
electron by the p-region causes a  difference of potential across
the junction of the two regions