Joining two carrier regions
A p-type region has holes as majority carriers, while electrons dominate an n-type region. When neighbouring regions form a junction, concentration differences drive diffusion. They are not simply two pieces carrying opposite bulk charges; before contact, both can be approximately electrically neutral.
Depletion region and internal field
Diffusion and recombination leave ionized dopant charges near the interface, producing a depletion region and built-in electric field. At thermal equilibrium, diffusion and field-driven drift balance so that net current is zero. This balance does not require every carrier’s microscopic motion to stop.
References: [1]
Forward and reverse bias
Forward bias lowers the barrier to majority-carrier flow and increases current. Reverse bias generally widens the depletion region and suppresses that flow, although current is not exactly zero and breakdown can occur. Describing a diode as a one-way valve is therefore a useful approximation, not an absolute law.
References: [1]
Light and manufactured junctions
Light-generated electrons and holes can be separated by the junction field, supporting photovoltaic and detection functions. Controlled diffusion improved junction depth and dopant profiles during the development of solar cells and transistors. Material quality, contacts and geometry remain important to the performance of a finished device.