Where are the rainforests? The Amazon? South-east Asia? How about mid and north Wales?

In fact, Wales is home to some of the last remaining examples of temperate rainforests in Europe.

A rainforest is defined as any woodland that thrives in conditions where there is over 200cm of precipitation a year.

While the flora and fauna of temperate rainforests differ from their tropical counterparts, they act as both a vital source of biodiversity and a massive carbon sink.

Another similarity they share is the inspiration for thousands of years of legends and folklore, many of which have a basis in scientific and geographical fact and act as cautionary tales about our misuse of the environment.

“Although tales in Welsh folklore, such as the Mabinogion, are mythical, the places and environments they describe are very real indeed,” according to Dr Juliette Wood, an expert in Welsh folklore at Cardiff University.

“They provide specific locations which can still be found today, and offer insights into how people interacted and managed the land on which they lived.”

In Wales, there are four main areas of rainforest: Eryri, also known as Snowdonia, in Gwynedd; Cwm Einion, in Ceredigion; Cwm Doethie-Mynydd Mallaen, in Ceredigion and Carmarthenshire; and the Elan Valley.

At their height 8,000 years ago, they helped form one contiguous forest from Wales to Scotland, and as recently as Roman times, provided a “Celtic super-highway” for the native Britons pushed north and west by the conquest.

Today they are managed by Celtic Rainforest Wales, a partnership of several woodland and wildlife charities funded by a nine-year EU grant.

At its peak, the rainforest would have covered 75% of Wales, according to Gethin Davies, senior manager at Celtic Rainforest Wales.

“From a low of less than 5% at the turn of the 20th Century, slowly we’re clawing it back towards 10%,” Mr Davies explained.

“They include a mix of oak, ash, hazel, birch and willow, and provide a habitat for hundreds of species of wildlife, most famously the endangered horseshoe bat and pine marten.

“Historically they have been devastated by deforestation for farmland and timber, but today the biggest threats are climate change, human activity on the ground, and especially non-native species.”

Possibly even more vital than the trees themselves is the ground-level ecoculture, which thrives in the dark and damp conditions under the canopy, which includes mosses, lichens, ferns and fungi.

As well as retaining moisture for tree roots, these low-lying species act as an early warning system when the health of the forest is threatened by invasion, drought or air pollution.

While manual or herbicidal removal of invasive plants is possible, Mr Davies said they can sometimes do more harm than good to the ground flora.

Therefore a key part of Celtic Rainforest Wales’ conservation strategy is to manage the forest floor with limited livestock grazing.

“It may sound counter-intuitive as the animals eat some of the nature we’re trying to preserve, but it helps clear the floor for new saplings, gets rid of some of the invasive plants and the manure fertilises the soil,” Mr Davies said.

“I guess you’re just replicating what once would have been a natural process several millennia ago.”

Dr Wood points to a story in the fourth branch of the Mabinogion, which suggests how both the importance of livestock-grazing and mysterious fungi were well known in legend.

“In the fourth tale, the hero, Pryderi, owns a herd of pigs who forage the forest floor, keeping it fertile and making their meat taste better.

“The nephew of the chief of north Wales, Gwydion, wants to acquire Pryderi’s herd and when Pryderi refuses, Gwydion magics up 12 stallions with golden saddles and bridles and twelve hounds from toadstools.

“Pryderi trades, but as soon as Gwydion leaves, the bounty returns to mushrooms and sticks.

“Although the stories are fantastical, I believe they do demonstrate a knowledge of the importance of grazing and hunting in the rainforest, as well as a nod to the magical effects they attributed to the fungi around which they lived.”

The tale doesn’t end well for Pryderi. Furious, he gives chase to Gwydion but is killed in battle.

Though even this is an indication of the historical basis of the myths, as both the site of the battle and the place of his burial in Maentwrog, a village in Gwynedd, are both locations you could seek out today.

At the height of deforestation between the late 18th and early 20th Centuries, land was cleared for sheep and cattle and the timber helped wage dozens of wars, with some even ending up in Nelson’s flagship HMS Victory.

Dr Wood believes a second wave of legends may have arisen to try to protect the forest.

“[Poet] Huw Llwyd was a very real 16th and 17th Century character, and ironically his farm at Cynfal Fawr was an example of precisely the sort of land clearance people were worried about,” she said.

“The real life Llwyd was a renaissance man – a poet, soldier and medic. By the 19th Century, when the focus was on preserving what was left of the forest and boosting tourism from England, his legend had grown to become something of a sorcerer with tales of magic and bygone hunting feats.

“An 1845 postcard depicts a boulder in the River Cynfal as being Huw Llwyd’s pulpit. There’s no evidence that he ever preached there – and indeed couldn’t have been heard over the noise of the river – but it’s another example of how ancient myth morphs into modern tourist legend to suit the needs and attitudes of the day.”