Why, for instance, should fireflies flash in unison? Biologists have offered at least 10 plausible explanations. The oldest one is called the beacon hypothesis. It has been known for decades that only the males synchronize their flashes; so, accodring to this view, the light show is directed at the females - a collective invitation to come hither. By blinking in concert, trhe males reinforce that seductive signal, beming it for miles through the jungle canopy, luring females who might not otherwise see any of them. This may be why synchrony is common in densely vegetated areas (like the jungles of Thailand and Malaysia [...]) but rare in the open meadows of the eastern US, where fireflies can easily tryst without it.
A second possible advantage of synchrony is that you might get lucky - a female with eyes for your look-alike neighbor might become confused and mate with you instead. for that matter, synchrony could be equally beneficial for confounding predators; it's always safest to blend in with a crowd. The latest theory is that synchrony reflects competition, not cooperation: every firefly is trying to be the first one to flash (because females seem to prefer that), but if everyone follows that strategy, sync automatically ensues.
steven strogatz SYNC, penguin books, 2003, p35.