Sometimes, Nature goes about things in convoluted ways.

In some rainforests around the world, scientists have discovered that the survival of certain poison dart frogs may actually depend on the activities of wild pigs, because the pigs, in a roundabout way, help the frog have babies.

The association stems from a particular aspect of poison dart frog behavior.

Typically, female poison dart (dendrobatid) frogs lay eggs on land. Once the tadpoles hatch, male frogs, their fathers, then carry them to small nursery pools.

But these pools may be short-lived, and the frogs are too tiny to dig their own.

Enter the peccary, a species of wild pig common in Central and South America.

Peccaries like to fling turf, specifically by digging out wallows – their own individual mud spas.

As they do so, they can radically transform the rainforest floor, creating pools of water that are just the right size for prospective frog parents.

Working in the rain forest of French Guiana, University of Vienna scientists Max Ringler, Walter Hödl, and Eva Ringler designed an experiment to investigate just how important peccary wallows are to the brilliant-thighed poison frog Allobates femoralis (pictured in header).

The team created peccary–like pools on the rainforest floor, comparing these engineered habitats to spots of unperturbed ground, they report in the journal Behavioral Ecology.

The scientists discovered that frog populations almost doubled in places with the pools, caused by a frog baby boom.

That suggests that wild pigs can be important ‘ecosystem engineers’ that help poison dart frogs reproduce.

However, like anything in life, there can be too much of a good thing.

In 2014, a separate team of scientists, led by Mark McKone of Carleton College, Minnesota, US, examined the population trends of a different frog species, the poison dart frog Oophaga pumilio, living in Costa Rica.

These frogs raise their tadpoles in the watery wells formed within the leaves of plants.

Here, the scientists found, the pigs like to eat the plants the frogs reside in, they reported in the Journal of Tropical Ecology.

And in doing so, they often swallow the frog babies with the plant-water.