The presence of local moment and delocalized conduction electrons leads to a competition of the Kondo interaction (which favors a non-magnetic ground state) and the RKKY interaction (which generates magnetically ordered states, typically antiferromagnetic for heavy fermions). By suppressing the Néel temperature of a heavy-fermion antiferromagnet down to zero (e.g. by applying pressure or magnetic field or by changing the material composition), a quantum phase transition can be induced. For several heavy-fermion materials it was shown that such a quantum phase transition can generate very pronounced non-Fermi liquid properties at finite temperatures. Such quantum-critical behavior is also studied in great detail in the context of unconventional superconductivity.