To get by in soil that is low in nutrients like nitrogen and phosphorous, some plants do something almost unthinkable—something that seems to go against the natural order of things: They become predators and carnivores, turning the tables on animals and adapting to eat them instead of being eaten.

There are some 600 known species of carnivorous plant in the world. The Venus fly trap is the most well known, but the pitcher plants probably come in a close second. These plants have modified leaves, shaped like pitchers or champagne flutes, that serve as traps. When an insect lands on one of these leaves, a slippery film of water and waxy secretions on the inside surface sends the bug sliding deeper into the pitcher, where it lands in a pool of digestive fluids that drown and dissolve it.

For some plants, though, these traps don’t work all the time. Some pitcher plant species don’t produce the waxy coating, and rely only on water to slick their leaves. When it’s raining, or when it’s humid and there’s some condensation on them, they’re deadly slip-and-slides. But when it’s sunny out or the humidity is low, the leaves stay dry and a bug can trot over them with no problems. Raffles' pitcher plant (Nepenthes rafflesiana), for example, grows in open sunny areas with low humidity, and its trap is inactive for as much as eight hours each day.

It shouldn’t work like that, says biologist Ulrike Bauer, because natural selection should favor adaptations that maximize prey capture and food intake. A trap that switches on and off according to the weather and doesn’t work for a third of the day goes against expectations as much as a plant that eats animals. Yet, traps that aren’t “always-on” are widespread in pitcher plants, so they can’t be too much of a disadvantage. Now, Bauer has found that they’re actually a neat adaptation, and that a temporarily ineffective trap can help plants capture more insects.

Raffles' pitcher plants feed on a wide array of insects, but ants make up about two-thirds of their diet. Ants are highly social creatures and share information with each other for the good of the colony, and when a lone scout ant sniffs out the pitcher’s bait, it soon recruits its nest-mates to share in the food. Therein lies the advantage of a sometimes-dry trap: the first ant can scope the pitcher out, but lives to tell its friends about it and inadvertently lure them to their doom.

Bauer and her colleagues showed this in Raffles' pitcher plants in Borneo by testing the capture rates of different traps on several plants. Half of the leaves were allowed to fluctuate between wet and dry naturally, while the other half were kept continuously wet by a water drip that the scientists rigged up.

After several days of monitoring the plants, the researchers removed all the captured insects and sorted and counted them (the pitchers had been plugged at the bottom with a foam ear plug to keep the prey from being lost). They found that flying insects were a reliable, steady, but not very plentiful source of food for both the always-on and the on-and-off plants. While the always-on pitchers trapped more of these flying bugs and had a higher baseline capture rate, the on-and-off pitchers caught more prey overall—about a third more than the always-wet ones.

The difference was because of ants. The pitchers that switched on and off naturally attracted an increasing number of ants over the course of the day, while the always wet ones didn’t. They also captured more ants in total than the always-on ones, capturing them twice as often in batches (10 or more ants) and were the only pitchers that captured them in large batches (sometimes trapping as many as 20 bugs at the same time). While their base capture rate was lower, the plants that dried out and became wet again over the course of the day made up for it with these occasional bigger meals.

The bouts of binge eating are possible because of the ants’ social nature. An ant scout that finds a food source will let other ants know about it so they can use it, too. A pitcher trap that’s always slippery will capture these scouts before they can spread the word, cutting off the plant’s prey supply. But a pitcher that’s off for part of the day and then becomes slippery later gives scout ants safe access to food and some time to recruit other ants, who arrive later and get captured in one sweep when the pitcher is wet. The plant does more with less, and exploits the ants’ collective behavior similar to the way some animal predators attack schools of fish or herd their prey together to maximize their catch.

Other pitcher plants have a more cooperative relationship with ants. Nepenthes bicalcarata forms a partnership with Camponotus schmitzi ants and provides living space for them in a swollen tendril at the base of its pitchers. In return for housing, nectar and some leftover bits of the plant’s catch, the ants protect the plants from weevils that eat its developing buds, and clean the sides of the pitcher traps to keep them nice and slick.