Group formation in animals is a widespread phenomenon driven by food acquisition, reproduction, and defense. Life in the ocean is characteristically aggregated into horizontally extensive layers as a result of strong vertical gradients in the environment. Each day, animals in high biomass aggregations called "deep scattering layers" migrate vertically, comprising the largest net animal movement on earth. This movement is commonly thought of as a predator avoidance tactic, however, the aggregation of animals into layers has been viewed as an incidental outcome of similar responses by many individuals to the risk of visual predation coupled with the location of resources including food and oxygen rather than active, socially mediated congregation for defense purposes. Here, using a newly adapted autonomous vehicle to measure individual characteristics, we provide the first measures of the internal layer structure, demonstrating that these features are made up of many topologically scaled, mono-specific aggregations, or "schools" rather than an indiscriminate mix of sizes and species. Schools responded to predators using behavior much like flash compression while neighboring aggregations increased their spacing to maintain coherent layers. Rather than simply an incidental outcome, the formation of layers of life in the sea is a highly organized process driven, at least in part, by biotic pressures for cohesion with broad adaptive significance for the myriad species that inhabit these ubiquitous features. These observations highlight the range of spatial scales we must examine in order to understand the strong impacts these high-biomass layers have on ecological and biogeochemical processes in the sea.