Perdew et al. discovered two different properties of exact Kohn–Sham density functional theory (DFT): (i) The exact total energy versus particle number is a series of linear segments between integer electron points. (ii) Across an integer number of electrons, the exchange-correlation potential “jumps” by a constant, known as the derivative discontinuity (DD). Here we show analytically that in both the original and the generalized Kohn–Sham formulation of DFT the two properties are two sides of the same coin. The absence of a DD dictates deviation from piecewise linearity, but the latter, appearing as curvature, can be used to correct for the former, thereby restoring the physical meaning of orbital energies. A simple correction scheme for any semilocal and hybrid functional, even Hartree–Fock theory, is shown to be effective on a set of small molecules, suggesting a practical correction for the infamous DFT gap problem. We show that optimally tuned range-separated hybrid functionals can inherently minimize both DD and curvature, thus requiring no correction, and that this can be used as a sound theoretical basis for novel tuning strategies.