A locust swarm in Madagascar this week eerily coincides with Passover, when Jewish people celebrate the story of their escape from Egypt. Exodus, as you may recall, recounts that before Moses was able to lead the Jews out of bondage, 10 plagues struck the Egyptians, ranging from rains of fire and frogs to a swarm of divinely summoned locusts.

But, absent an angry God, how does a locust swarm arise? It turns out you might be able to do it with antidepressants.

The term “locust” refers to any one of several species in the grasshopper family Acrididae that, when their population reaches a certain tipping point within a certain area, will suddenly abandon a solitary lifestyle and become what scientists refer to as “gregarious,” which is a polite term for “ravenous swarm of rapidly breeding insects that gobbles up crops for miles around.” The insects have adapted this swarming strategy to cope with strained resources caused by their population explosion.

Oftentimes the switch from a solitary lifestyle to a gregarious one is accompanied by a color change, usually from green or brown to a bright yellow. Those marked differences meant that for some time, people thought swarming locusts and solitary grasshoppers were separate species.

A locust swarm can wreak serious havoc on a wide area -- one 2004 outbreak in Africa destroyed at least 90 percent of cereal crops in Mali and Mauritania, and gobbled up 80 percent of cereal production in Burkina Faso.

Researchers have known that gregarious behavior in locusts can be triggered by crowding, but the exact chemical signal that flipped the switch wasn’t discovered until 2009.

"We knew the [physical] stimuli that cause locusts' amazing Jekyll and Hyde-style transformation,” Oxford University scientist Michael Anstey told the BBC, “but nobody had been able to identify the changes in the nervous system that turn antisocial locusts into monstrous swarms.”

Anstey and colleagues from the University of Cambridge and Sydney University tickled the legs of grasshoppers in the lab -- to simulate the experience of being crowded by other insects -- and induced some of the bugs to swarm. The swarming locusts turned out to have much higher levels of the brain chemical serotonin, which is linked to positive moods. (The chief mechanisms of most antidepressants and anti-anxiety drugs lies in the serotonin pathway … as does the activity of many psychedelic agents, like mescaline, LSD and "magic mushrooms".)

Knowing that serotonin is the key to locust swarming behavior suggests that some sort of serotonin inhibitor could keep grasshoppers antisocial.

"Serotonin profoundly influences how we humans behave and interact," Cambridge researcher Swidbert Ott told the BBC. "So to find that the same chemical is what causes a normally shy, antisocial insect to gang up in huge groups is amazing."

At the moment, most control strategies involve a) lots of pesticide and b) keeping an eye out to spot swarms before they start. Nowadays, scientists and governments can keep a more high-tech eye out for locust swarms thanks to satellite imaging. In the Middle East and Africa, the thing to look for is for sudden vegetative blooms in the desert. The locusts hatch from eggs buried in the sandy soil when the leaves open, giving them something to eat. If satellites detect a sudden burst of green in an area, that can alert officials to deploy special squads to obliterate the plague.

“The idea is that if we can detect the outbreaks and then control them, then we won't have a situation like we had in 2004," Keith Cressman, senior locust forecasting officer with the Food and Agriculture Organization of the United Nations, told Nature in 2011. "But that will depend on individual countries, politics, security and all those things.”