(N/A) When a $p-n$ junction is formed,electrons diffuse from the $n$-region to the $p$-region,and holes diffuse from the $p$-region to the $n$-region due to the concentration gradient.
As electrons leave the $n$-region,they leave behind positively charged donor ions. Similarly,as holes leave the $p$-region,they leave behind negatively charged acceptor ions. These immobile ions create a region near the junction depleted of mobile charge carriers,known as the depletion region.
This charge distribution creates an electric field directed from the $n$-side to the $p$-side. This electric field creates a potential difference across the junction,which opposes the further diffusion of charge carriers. This potential difference is called the barrier potential $(V_0)$.
In equilibrium,the barrier potential prevents further diffusion,maintaining the charge neutrality of the diode.