In the TED talk there was little information about how the formation-flying drones relate to each other except a suggestion that each one 'senses' the proximity of its neighbours (didn't say how) and decides what to do to keep a proper distance: if that's all, there'd likely be a ripple effect which would cause the formation to wobble or 'hunt' around its desired flight-path, yet that doesn't seem to happen in the video.
In the video about drone light shows, there's no mention of proximity sensing: simply, each participating drone's flight path is set beforehand, the computer having worked out all the flight paths beforehand so as to create the desired effect without collisions.
Now try the swarming behaviour of animals – famously starlings ('murmurations') but also other birds, fish, insects, etc, which are able to fly or swim in thousands without collisions. Mk 1 eyeball for proximity detection, no doubt, but there's more to it than that. (Humans on the ground are bad at swarming, by the way – they bump into each other all the time.)