In some contexts, elephants and people coexist peacefully. Until recently, some zoos afforded visitors the luxury of riding the back of an elephant around some of the grounds, but that practice has been largely discontinued due to concerns for the animals’ safety. Nevertheless, there are plenty of examples of elephants — the larger of the two species — leaving humans generally unharmed.

But that isn’t always the case. Take parts of Africa, for example, where expansions in farmland have encroached on the habitats of elephants. The elephants, of course, do not take kindly to this intrusion and have been known to raid the farms in search of food, destroying fields of crops in the process. Keeping the elephants out is a dangerous and difficult task, but one research has developed an elegant — and profitable — solution: bees.

Elephants are known for their excellent memories. It is said that elephants never forget, and while that’s hyperbole, it is certainly true that the creatures have a good aptitude for recalling times and events that have caused them injury. And it’s likely that they also have some nuance in their trunk-blast driven language as well. In 2010, a researcher named Lucy King determined that East African elephants have a unique sound they make when they come across an area infested with bees. Bees are a particularly harmful pest to elephants, as the insects can sting the beasts near the eyes or from inside the latter’s trunks. The elephants’ calls act as an alarm, warning the other elephants to stay away.

A year or so later, King combined these two elements — the elephants’ fear of bees and their excellent memories — into a new theory: beehive “fences.” If farmers and the like could surround their land with bees, elephants which encountered the perimeters would not only learn to stay away, but communicate the danger to other pachyderms. Her pilot program, involving 34 farms in Kenya, was highly successful. When the elephants encountered the (actual) fences surrounding the farms, they shook them, disturbing the hives and releasing the bees. The elephants often fled the area.

As a bonus? The bees produce honey, which the farmers collect at a profit.

Bonus fact : The term “white elephant,” per the Merriam-Webster dictionary, means “a property requiring much care and expense and yielding little profit.” The origins of the term date back to the 1800s, when the King of Siam used to make gifts of actual white elephants to those people in his service in whom he lost trust or faith. The recipients of these elephants risked financial ruin due to the creature’s care and upkeep.

From the Archives: Early Warning Lemurs: After a recent earthquake, an elephant at the National Zoo in D.C. hid. The lemurs? They felt it coming.

Related: A white elephant.