Moving animal groups display remarkable feats of coordination. This coordination is largely achieved when individuals adjust their movement in response to their neighbours' movements and positions. Recent advancements in automated tracking technologies, including computer vision and GPS, now allow researchers to gather large amounts of data on the movements and positions of individuals in groups. Furthermore, analytical techniques from fields such as statistical physics now allow us to identify the precise interaction rules used by animals on the move. These interaction rules differ not only between species, but also between individuals in the same group. These differences have wide-ranging implications, affecting how groups make collective decisions and driving the evolution of collective motion. Here, I describe how trajectory data can be used to infer how animals interact in moving groups. I give examples of the similarities and differences in the spatial and directional organisations of animal groups between species, and discuss the rules that animals use to achieve this organisation. I then explore how groups of the same species can exhibit different structures, and ask whether this results from individuals adapting their interaction rules. I then examine how the interaction rules between individuals in the same groups can also differ, and discuss how this can affect ecological and evolutionary processes. Finally, I suggest areas of future research.