Diffusion Current: Charge carriers move from regions of higher to lower concentration, driven by the concentration gradient. Within a p-n junction, electrons migrate from the n-side to the p-side, and holes move from the p-side to the n-side. This process establishes a depletion region and an intrinsic electric field. Drift Current: Charge carriers are propelled by an electric field. In a p-n junction, the electric field within the depletion region forces electrons towards the n-side and holes towards the p-side, opposing the diffusion current. P-N Junction Formation: Initially, diffusion is the dominant process, leading to the formation of the depletion region. This depletion region then generates an electric field, resulting in a drift current. A state of dynamic equilibrium is achieved when the drift current equals the diffusion current.