A semiconductor p-n junction forms when p-type and n-type silicon crystals meet, establishing a steep majority carrier concentration gradient across the interface. Mobile holes diffuse from the p-region into the n-region while mobile electrons diffuse from the n-region into the p-region, recombining and leaving behind uncompensated, fixed ionized dopant cores (negative acceptor ions in p, positive donor ions in n). This uncovered space-charge layer forms a depletion region with a strong built-in electric field that opposes further diffusion, reaching dynamic thermal equilibrium.