The social brain hypothesis postulates the increasing complexity of social interactions as a driving force for the evolution of cognitive abilities. Whereas dyadic and triadic relations play a basic role in defining social behaviours and pose many challenges for the social brain, individuals in animal societies typically belong to relatively large networks. How the structure and dynamics of these networks also contribute to the evolution of cognition, and vice versa, is less understood. Here we review how collective phenomena can occur in systems where social agents do not require sophisticated cognitive skills, and how complex networks can grow from simple probabilistic rules, or even emerge from the interaction between agents and their environment, without explicit social factors. We further show that the analysis of social networks can be used to develop good indicators of social complexity beyond the individual or dyadic level. We also discuss the types of challenges that the social brain must cope with in structured groups, such as higher information fluxes, originating from individuals playing different roles in the network, or dyadic contacts of widely varying durations and frequencies. We discuss the relevance of these ideas for primates and other animals societies.