Many societies of the past were conglomerations of tribes where each group/tribe had their own hierarchy and the various groups interacted with various kinds of hierarchy or lack thereof. Think of ancient Gaul or North American native nations. Despite them being formally independent groups, a common culture united people against what they perceived foreign. Gauls resisted Roman invasion, and even managed some degree of cohesion under Vercingetorix because they felt the threat of the common enemy.