‘Adapt to endure’ has become a necessity in agriculture, but the means to do so remain largely undefined. The aim of this literature review is to analyse how the herd contributes to a livestock farming system's capacity to adapt to a changing world and evolve when the future is uncertain. We identify six categories of elements linked to the herd, called ‘sources of flexibility’, that are used to manage perturbation. The first three are: using the animal's adaptive capacities, using the diversity of species and breeds and combining the diversity of animal products. The last three are: organising the mobility of animals and livestock farmers, juggling the herd numbers and mastering the balance between productivity and herd survival. These sources of flexibility are described in the literature by studying the different ways in which they are used. For example, the ‘juggle herd numbers’ source is described by volume, categories of animals, type of transfer, such as births, purchases or gifts, and timing of use, especially linked to the timing of the perturbation. Identified studies also compare or rank sources and analyse the connections between them. The flexibility framework (management science) is used for this analysis according to the levels of organisation of a livestock farming system: a strategic level referring to long-term options and to the capacity to modify the system structure, and an operational level referring to adjustment decisions during the productive cycle, the presence or absence of intervention by the livestock farmer, and the time scales involved. We conclude that the decision to use one or another source (in terms of modalities, alternatives, scheduling and combinations) is made according to the production objectives, the structural means, the type/frequency/intensity of perturbations and the context/environment. Consequently, the flexibility of a livestock farming system cannot be assessed in absolute terms. Enhancing flexibility needs management of all elements and scales involved (and not only the herd), and requires diversity to be organised at different scales.