We aim to advance the current knowledge about the role played by heterogeneity and interdependence in the collective behavior of different artificial and natural complex systems, from microrobots up to social animals. We will focus our research on the role of heterogeneity and memory effects, with direct applications to the collective motion of animals and robot ensembles. We apply statistical and network theory tools to account for different sources of heterogeneity present in groups of social animals, as well as their effect on their ordering and collective dynamics. This work is carried out using both an analytical perspective, developing and analyzing simple models of synthetic systems, and an empirical perspective, analyzing experimental fish schools.