Two major processes take place during the formation of a p–n junction is diffusion and drift.
Diffusion: In an n-type semiconductor, electrons are present in much higher concentration than holes, whereas in a p-type semiconductor, holes are present in much greater concentration than electrons. When the p–n junction is formed, the difference in concentration causes holes to move from the p-region to the n-region (p → n) and electrons to move from the n-region to the p-region (n → p). This movement of charge carriers across the junction results in the formation of a diffusion current.

Drift: Drift of charge carriers occurs due to the electric field created at the junction. Because of the built-in potential barrier, an electric field is established from the n-region to the p-region. This electric field causes electrons on the p-side to move toward the n-side and holes on the n-side to move toward the p-side. As a result, a drift current is produced, which flows in the direction opposite to the diffusion current.


