It's one of entomology's great mysteries: Why a ragtag group of locusts will occasionally whip into a frenzy, collectively chomping foliage and even each other. Now researchers partially funded by the National Science Foundation think they've figured it out—thanks to Facebook.

By applying something called an adaptive network model, often used to analyze social media, the researchers examined the links between mutually aware insects (think: Facebook's "friends") and were able to create a better predictor of when locusts will swarm.

Peer pressure is key: The more time locusts spend moving together in the same direction, the harder it is for the group to reverse course, which leads to swarming. Sound familiar? People get stuck in groups that turn into frenzied action, but for us, these clusters are built around common interests, politics, and background. "The longer you have an opinion, the longer you'll have neighbors who share it and the higher the probability that everyone in the group is marching in the same direction," says Cristián Huepe, lead author of the locust study. Locusts are like people on Facebook in another way, too: The denser the huddle of bugs, the more likely they are to act as a mob. And the cannibalism? A locust deprived of salt and protein will get some by sinking its jaws into another locust. As it turns out, "it's complicated" applies to grasshoppers, too.