Abstract: Many biological systems are complex aggregates of multiple agents working together towards collective, higher-order goals without central control. System components rely on local cues to determine their behavior. Therefore, the composition of a group, the way its members interact, and the physical environment in which these interactions occur can all affect the success of the group as a whole. In my talk I will show how environment, interaction patterns, group composition, and the genetic mechanisms that underlie individual variation shape collective outcomes. I address these questions by combining field and lab studies with computer simulations, theoretical work, image analysis, and social network analysis. I will highlight novel findings that have emerged from newly developed methods for investigating multidimensional behavioral spaces. By identifying principles that explain how complex animal societies operate, this work can provide novel insights into other systems that cannot be broken down to their components, yet their emergent functions rely on how their components vary and interact.