In social insect colonies, many tasks are performed by higher-order entities, such as groups and teams whose task solving capacities transcend those of the individual participants. In this paper, we investigate the emergence of such higher-order entities using a colony of up to 12 physical robots. We report on an experimental study in which the robots engage in a range of different activities, including exploration, path formation, recruitment, self-assembly and group transport. Once the robots start interacting with each other and with their environment, they self-organise into teams in which distinct roles are performed concurrently. The system displays a dynamical hierarchy of teamwork, the cooperating elements of which comprise higher-order entities. The study shows that teamwork requires neither individual recognition nor inter-individual differences, and as such might contribute to the ongoing debate on the role of such characteristics for the division of labour in social insects.