To the pig-tailed macaque, there's nothing better than sweet fruit plucked from a sprawling palm oil plantation. Except maybe fresh rat. That's good eating too, apparently.

Researchers have found that far from being a pest themselves, monkeys could be welcome guests at Malaysian palm oil plantations, more than making up for the few fruit they steal by keeping down the numbers of a far more serious threat in the form of rodents.

For the past six years, scientists from Malaysia and Germany have kept a close eye on two populations of southern pig-tailed macaques (Macaca nemestrina) in Malaysia's Segari Melintang Forest Reserve.

Naturally, the monkeys spent a good deal of time chilling in the palm oil plantation that surrounded the reserve, which made up roughly a third of their home range.

Farmers might not be happy with the intrusion, but for the macaque, the palms were the equivalent of a shopping mall - an ugly monoculture intruding on beautiful surrounds, but with cheap food.

The macaques were spending several hours a day in the plantations, a period that made up nearly half of their overall feeding time.

It didn't come as much of a surprise that they were busy stuffing their faces with fruit from the palm trees. What was a bit of a shock was the main course – a whole bunch of rats.

"I was stunned when I first observed that macaques feed on rats in plantations," says Nadine Ruppert, an ecologist from the Universiti Sains Malaysia.

"I did not expect them to hunt these relatively large rodents or that they would even eat so much meat. They are widely known to be frugivorous primates who only occasionally feast on small birds or lizards."

The observation posed an interesting question – were the monkeys truly the farmers' foes, or was it a small cost to pay for a convenient pest-control service?

Crunching the numbers, the researchers found the monkeys were consuming more than 12 tons of palm fruits per year. If that sounds like a lot, it's a little over half a percent of the total output of the part of the plantation covering their home range.

It's also nothing compared to the damage caused by rats, which could potentially chew their way through as much as 10 percent of the plantation's produce.

If the monkeys were catching a rat or two for an occasional delicacy, it might not make much of a difference. But it turns out macaques can tear through serious amounts of rodent cuisine.

"By uncovering cavities in oil palm trunks where rats seek shelter during the day, one group of pig-tailed macaques can catch more than 3,000 rats per year," says University of Leipzig anthropologist, Anna Holzner.

This adds up. Having a hungry population of primate rat-catchers visit regularly could drop that massive 10 percent loss down to just 2 percent.

Of course, there's then the added monkey tax of 0.56 percent. But any accountant could see that a loss of less than 3 percent is still a bargain.

Even without balancing the figures, there's the ethics of conservation to consider. Palm oil plantations are big business across south-east Asia, but at a considerable cost to the environment.

Having an incentive to find ways to turn plantations into wildlife corridors could go some way in salvaging the industry's dire reputation when it comes to its impact on wildlife.

"We expect that our results will encourage both private and public plantation owners to consider the protection of these primates and their natural forest habitat in and around existing and newly established oil palm plantations," says the study's senior author, Anja Widdig from the University of Leipzig.

"This ultimately can lead to a win-win situation for both biodiversity and the oil palm industry."

This research was published in Current Biology.