I study how the complex behavior of animal societies emerges from the interactions of group members, despite the absence of any well-informed central controller. I focus particularly on the rich examples found in ants, bees, and other social insects. The appearance of order at one scale from purely local interactions at a lower scale is a general theme of modern biology, seen in genetic, neural, social, and ecological networks. My goal is to understand this process in systems whose middle rank between organisms and populations makes them especially tractable. My approach is to identify the behavioral rules, cues, and signals used by individuals, and to experimentally test hypotheses of how these parts interact to yield colony-level behavior. Because intuition alone cannot take in this complexity, I rely extensively on mathematical and computational approaches. I also have extensive collaborations with engineers seeking to imitate the robust, decentralized coordination of animal groups as they design cooperative teams of autonomous robots.