There are exactly two ways charge carriers move in a semiconductor: diffusion, driven by a concentration gradient, and drift, driven by an electric field. Every current in a PN junction, diode, or transistor is one or both of these, and the junction’s equilibrium is precisely the point where they cancel.
Diffusion current
Diffusion is the spreading of carriers from where they are crowded to where they are sparse — the same physics as a drop of ink dispersing in still water or a smell spreading across a room. No force is needed; random thermal motion alone, on average, moves more carriers out of a high-concentration region than into it, so there is a net flow down the concentration gradient.
In a semiconductor the carriers are charged, so this net flow of particles is a net flow of current. The electron diffusion current density is and the hole one is , where is the electron charge, and the carrier concentrations, position, and , the diffusion coefficients. The size of the current is set by how steep the concentration gradient is.
[Background from general knowledge, not the source PDF]
This is what kicks off a PN junction: electrons are vastly more concentrated on the n-side than the p-side (and holes vice versa), so they diffuse across the metallurgical junction.
Drift current
Drift is the ordinary motion of charges under an applied electric field — the mechanism behind current in a plain resistor. An electric field exerts a force on each carrier, giving it an average velocity (drift velocity) on top of its random thermal motion. The drift current density is , where and are the electron and hole mobilities. More carriers, or a stronger field, means more drift current. Electrons and holes drift in opposite directions under the same field, but because they carry opposite charge, both contribute current in the same direction.
[Background from general knowledge, not the source PDF]
They oppose each other at the junction
In a PN junction the two mechanisms fight, and that fight defines equilibrium. Diffusion drives majority carriers across the junction. As they leave they expose fixed dopant ions, building the Depletion region and its electric field. That field then drives a drift current of carriers in the opposite direction to the diffusion. The field grows until:
At that balance the junction is in thermal equilibrium, with the Built-in voltage standing across the depletion region. Nothing is moving on net, but both currents are individually large and exactly cancelling.
Both reappear under bias
Biasing tips the balance. Forward bias lowers the barrier so diffusion overwhelms drift and a large net diffusion current flows. Reverse bias raises the barrier so diffusion is choked off and only a small drift current of swept minority carriers remains — the Reverse saturation current. Every operating mode of a diode and a transistor is some disturbance of the drift–diffusion balance set up here.