  Representing social systems as networks, starting from the interactions
between individuals, sheds light on the mechanisms governing their dynamics.
However, networks encode only pairwise interactions, while most social
interactions occur among groups of individuals, requiring higher-order network
representations. Despite the recent interest in higher-order networks, little
is known about the mechanisms that govern the formation and evolution of
groups, and how people move between groups. Here, we leverage empirical data on
social interactions among children and university students to study their
temporal dynamics at both individual and group levels, characterising how
individuals navigate groups and how groups form and disaggregate. We find
robust patterns across contexts and propose a dynamical model that closely
reproduces empirical observations. These results represent a further step in
understanding social systems, and open up research directions to study the
impact of group dynamics on dynamical processes that evolve on top of them.
