Since its launch in 2004, the Swift satellite has monitored the X-ray afterglows of several hundred gamma-ray bursts (GRBs), and revealed that their X-ray light curves are more complex than previously thought, exhibiting up to three power-law segments. Energy injection into the relativistic blast wave energizing the burst ambient medium has been proposed most often to be the reason for the X-ray afterglow complexity. We examine 117 light-curve breaks of 98 Swift X-ray afterglows, selected for their high-quality monitoring and well-constrained flux decay rates. 30 per cent of afterglows have a break that can be an adiabatic jet break, in the sense that there is one variant of the forward-shock emission from a collimated outflow model that can account for both the pre- and post-break flux power-law decay indices, given the measured X-ray spectral slope. If allowance is made for a steady energy injection into the forward shock, then another 56 per cent of X-ray afterglows have a light-curve break that can be explained with a jet break. The remaining 12 per cent that are not jet breaks, as well as the existence of two breaks in 19 afterglows (out of which only one can be a jet break), suggest that some X-ray breaks arise from a sudden change in the rate at which energy is added to the blast wave, and it may well be that a larger fraction of X-ray light-curve breaks are generated by that mechanism. The fractional increase in the shock energy, inferred from the energy injection required to account for the observed X-ray flux decays, may be anticorrelated with the GRB prompt output, whether the X-ray break is a jet break or an energy-injection break. That anticorrelation can also be seen as bursts with a higher energy output being followed by faster fading X-ray afterglows. To test the above two mechanisms for afterglow light-curve breaks, we derive comprehensive analytical results for the dynamics of outflows undergoing energy injection and for their light curves, including closure relations for inverse-Compton afterglows and for the emission from spreading jets interacting with a wind-like ambient medium.