A universal gate is a single gate type that can build every other logic function using only copies of itself. NAND and NOR are universal. AND, OR, NOT, XOR and XNOR are not.
To prove a gate is universal, you only need to build NOT and AND (or NOT and OR) from it. Every Boolean function can be written as a sum of products of AND, OR and NOT, and De Morgan's law turns AND plus NOT into OR.
The classic constructions with 2-input gates:
- NOT: one NAND (or NOR) with its inputs tied together.
- AND: NAND then a NAND-inverter, 2 gates. From NORs it takes 3.
- OR: NOR then a NOR-inverter, 2 gates. From NANDs it takes 3.
- NOR from NANDs, or NAND from NORs: 4 gates.
Why it matters: a chip built from one repeated cell is simpler to design and manufacture. In CMOS, NAND and NOR are also the cheapest 2-input gates, so real designs lean on them. Two-level nand nand logic and nor nor logic let you build any function directly.
Why the others fail: AND and OR can never produce an inversion, and XOR gates only ever make parity-style functions. See functional completeness for the general idea, which applies to sets of gates as well as single ones.