Collective motion emerges from individual interactions which produce groupwide patterns in behavior. While adaptive changes to collective motion are observed across animal species, how local interactions change when these collective behaviors evolve is poorly understood. Here, we use the Mexican tetra, A. mexicanus, which exists as a schooling surface form and a non-schooling cave form, to study differences in how fish alter their swimming in response to neighbors across ontogeny and between evolutionarily diverged populations. We find that surface fish undergo a transition to schooling during development that occurs through increases in inter-individual alignment and attraction mediated by changes in the way fish modulate speed and turning relative to neighbors. Cavefish, which have evolved loss of schooling, exhibit neither of these schooling-promoting interactions at any stage of development. These results reveal how evolution alters local interaction rules to produce striking differences in collective behavior.