Actors, Baby! Check out Source

These balls are each controlled by their own autonomous coroutine. If balls hit each other, they will disable collision detection on each other for a bit. This is what causes the grouping that you see.