  In 1988 the NA31 experiment presented the first evidence of direct CP
violation in the $K^0\to\pi\pi$ decay amplitudes. A clear signal with a
$7.2\,\sigma$ statistical significance was later established with the full data
samples from the NA31, E731, NA48 and KTeV experiments, confirming that CP
violation is associated with a $\Delta S=1$ quark transition, as predicted by
the Standard Model. However, the theoretical prediction for the measured ratio
$\varepsilon'/\varepsilon$ has been a subject of strong controversy along the
years. Although the underlying physics was already clarified in 2001, the
recent release of improved lattice data has revived again the theoretical
debate. We review the current status, discussing in detail the different
ingredients that enter into the calculation of this observable and the reasons
why seemingly contradictory predictions were obtained in the past by several
groups. An update of the Standard Model prediction is presented and the
prospects for future improvements are analysed. Taking into account all known
short-distance and long-distance contributions, one obtains
$\mbox{Re}\left(\varepsilon'/\varepsilon\right) = (15 \pm 7)\cdot 10^{-4}$, in
good agreement with the experimental measurement.
