the p-n junction
The p-n junction is what you get when a piece of p-type semiconductor meets a piece of n-type semiconductor inside one crystal. It is the single most important structure in electronics — the elementary building block of the diode, the transistor, the solar cell, the LED. Its defining trick is that it lets current flow easily in one direction and blocks it in the other: it is a one-way valve for electric current.
Here is what happens the moment the two sides join, in plain steps. The n-side is crowded with electrons, the p-side with holes. Just as gas rushes from a full room into an empty one, electrons diffuse across into the p-side and holes diffuse into the n-side, and where they meet they cancel. This leaves behind a thin region near the boundary swept clean of mobile carriers, called the depletion region, containing only the fixed dopant ions — positive on the n-side, negative on the p-side. Those exposed ions set up a built-in electric field, and hence a built-in voltage (about 0.7 V for silicon), that pushes back and stops further diffusion. Equilibrium is reached exactly when the two sides' Fermi levels line up.
Now apply an external voltage. Push the p-side positive (forward bias) and you fight the built-in field, shrink the depletion region, and current flows freely. Push the p-side negative (reverse bias) and you reinforce the built-in field, widen the depletion region, and almost no current flows. That asymmetry is rectification — turning alternating current into one-way current — and it is the reason the p-n junction is the bridge from materials to devices. Honest note: this glossary stops at the junction as a material phenomenon; how junctions are wired into diodes and transistors belongs to the electronics domains, not here.
A p-n junction is a check valve for current. Forward bias (p-side positive, above about 0.7 V for silicon) opens it and current pours through; reverse bias closes it and only a tiny leakage passes. Feed it alternating current and it chops off the reverse halves, passing only one direction — the basic act of rectification behind every power adapter.
Diffusion + a built-in field make a one-way valve: current flows forward, is blocked in reverse.
A p-n junction must be one continuous crystal — you cannot make one by simply pressing an n-type chip against a p-type chip, because the disrupted, oxide-covered surfaces would not share a clean band structure. The junction is formed inside a single crystal by doping adjacent regions differently.