We develop a conceptual framework for the understanding of animal personalities in terms of adaptive evolution. We focus on two basic questions. First, why do behavioural types exhibit limited behavioural plasticity, that is, behavioural correlations both across contexts and over time? Second, how can multiple behavioural types coexist within a single population? We emphasize differences in 'state' among individuals in combination with state-dependent behaviour. Some states are inherently stable and individual differences in such states can explain stable differences in suites of behaviour if it is adaptive to make behaviour in various contexts dependent on such states. Behavioural stability and cross-context correlations in behaviour are more difficult to explain if individual states are potentially more variable. In such cases stable personalities can result from state-dependent behaviour if state and behaviour mutually reinforce each other by feedback mechanisms. We discuss various evolutionary mechanisms for the maintenance of variation (in states and/or behaviour), including frequency-dependent selection, spatial variation with incomplete matching between habitat and phenotype, bet-hedging in a temporally fluctuating environment, and non-equilibrium dynamics. Although state differences are important, we also discuss how social conventions and social signalling can give rise to adaptive personality differences in the absence of state differences.