Adaptive immunity is mediated through numerous genetic and cellular processes that generate favourable somatic variants of antigen-binding receptors under evolutionary selection pressure by pathogens and other factors. Advances in our understanding of immunity in mammals and other model organisms are revealing the underlying basis and complexity of this remarkable system. Although the evolution of adaptive immunity has been thought to occur by the acquisition of novel molecular capabilities, an increasing amount of information from new model systems suggest that co-option and redirection of pre-existing systems are the main source of innovation. We combine evidence from a wide range of organisms to obtain an integrated view of the origins and patterns of divergence in adaptive immunity.