One contribution of 16 to a discussion meeting issue 'Origin and evolution of the nervous system'. Large, complex brains have evolved independently in several lineages of protostomes and deuterostomes. Sensory centres in the brain increase in size and complexity in proportion to the importance of a particular sensory modality, yet often share circuit architecture because of constraints in processing sensory inputs. The selective pressures driving enlargement of higher, integrative brain centres has been more difficult to determine, and may differ across taxa. The capacity for flexible, innovative behaviours, including learning and memory and other cognitive abilities, is commonly observed in animals with large higher brain centres. Other factors, such as social grouping and interaction, appear to be important in a more limited range of taxa, while the importance of spatial learning may be a common feature in insects with large higher brain centres. Despite differences in the exact behaviours under selection, evolutionary increases in brain size tend to derive from common modifications in development and generate common architectural features, even when comparing widely divergent groups such as vertebrates and insects. These similarities may in part be influenced by the deep homology of the brains of all Bilateria, in which shared patterns of developmental gene expression give rise to positionally, and perhaps functionally, homologous domains. Other shared modifications of development appear to be the result of homoplasy, such as the repeated, independent expansion of neuroblast numbers through changes in genes regulating cell division. The common features of large brains in so many groups of animals suggest that given their common ancestry, a limited set of mechanisms exist for increasing structural and functional diversity, resulting in many instances of homoplasy in bilaterian nervous systems.