For every electron that diffuses across the junction and combines with a hole, a positive charge is left in the n region
and a negative charge is created in the p region, forming a barrier potential.
This action continues until the voltage of the barrier repels further diffusion.
The blue arrows between the positive and negative charges in the depletion region represent the electric field.