The bog at Forsinard stretches to the horizon, a vast mosaic of greens and browns. The tallest plants here grow only ankle high, but even so, walking requires careful attention. Hummocks covered in heather (Calluna vulgaris) or cotton grass (Eriophorum spp.) offer lumpy but secure footing. Soggy patches of sphagnum moss are less predictable.

These bogs, in northern Scotland’s Flow Country, are deceptive in more ways than one. Beneath the moss and the heather and the sedge lies one of the planet’s largest surviving expanses of peat – a nutrient-poor, carbon-dense mass of partly decayed organic matter. But here lies the peatland’s hidden strength: a prodigious ability to lock away carbon, making it an important resource in the fight against climate change.

The bogs are also home to a diverse assemblage of species, many uniquely adapted to its unusual conditions, and provide a critical breeding habitat for migratory birds.

In Britain and beyond, people have drained large swaths of peatland and converted it to pasture or crop land for centuries. An estimated 80% of Britain’s peat bogs have been damaged or destroyed. Today, however, the country is on the leading edge of a global peatland restoration movement, and the programme at Forsinard is among the largest of these efforts.

Peat is made up of partly decayed plant parts, pickled in acid released by living sphagnum moss. Plants in the vast bog at Forsinard are both rooted in peat and laying down new peat as time passes – a process that began about 10,000 years ago at the end of the last ice age. A mass of healthy peat is about 90% water, which it filters and purifies, and houses a small group of specialised plants that have adapted to the extreme conditions of a nutrient-poor, waterlogged, acidic habitat.

Scientists now know that peat ecosystems are the most powerful carbon sinks on Earth. They are capable of holding twice as much carbon per hectare as a pristine redwood forest, the planet’s second-most carbon-rich ecosystem, says Hans Joosten of the Greifswald Mire Centre in Germany. Scotland’s peat bogs, which comprise more than 20% of the country’s land area, hold about 75% of the carbon locked away in all British soils and vegetation – which is why their restoration has become such a priority.

In the 1980s, the British government subsidised a blitz of bog drainage in order to plant exotic trees for marketable timber. (Since the first world war, when a lack of available timber hindered Britain’s war effort, the country has viewed creating forests as a national good.)

The resulting plantations of lodgepole pine (Pinus contorta) and Sitka spruce (Picea sitchensis), species native to North America, failed to thrive. The Flow Country had been treeless for thousands of years for good reason. Peat soil is often too acidic and nutrient-poor to support healthy trees, and the Flow Country endures howling winter winds of up to 90mph, which can stunt their growth or yank them out by the roots.

During the forestry boom, the government offered grants to those interested in ploughing up natural bogs to plant trees, and provided tax relief to wealthy forestry investors. Overall, 67,000 hectares (165,560 acres) – 17% of the ancient peatland of Flow Country – was drained. Some of Britain’s richest citizens reaped impressive profits, but usable timber was rarely produced. In most cases, the plantations have grown only spindly trees that are unsuitable for lumber, so are used as biofuel or simply abandoned. While these ill-conceived forests haven’t produced much wood, they did trigger one of the fiercest environmental battles in British history.

Richard Lindsay had just begun to survey the life of the Flow Country when the government’s timber incentive programme began. He and his colleagues at the UK’s now-disbanded Nature Conservancy Council hurried to record the beauty and biodiversity of wild Flow Country bogs moments before ploughs began ripping them apart to create tree plantations. “We were literally running along right in front of the ploughs,” he remembers. “We would go and survey an area one day, and go back the next day to see the ploughs [pass] right through the area that we’d just surveyed.”

Living in pop-up tents, walking long distances across the formidable bog, Lindsay’s crew explored an intricate world where water equalled life. They found a community of different sphagnum and sedge species – some adapted to live on the raised hummocks and ridges, others thriving in the lower, soggier spots. They discovered that the rolling terrain hid mazes of pools, where diving beetles moved busily between the surface and the bottom, caddisfly larvae trundled along inside protective shells they’d built from bits of clay and pebbles, and newts and frogs fed on the insects.

This aquatic abundance also supported droves of migratory birds. Ornithologists who rushed to study the Flow Country found a spectacular array of breeding species. In April, when the migratory waders arrive, the bogs come alive with graceful birds flying, calling, and soon after, incubating their eggs. Throughout the spring and summer, wading birds stalk the edges of bog pools, picking off prey to feed their chicks. In addition to offering rich hunting grounds, the bog provides ideal camouflage. The grey, white, and black plumage of common greenshanks (Tringa nebularia), large sandpipers named for the light-green hue of their legs, disappears against the sedge and heather. Golden plover (Pluvialis apricaria) hatchlings look like little more than a heap of sphagnum moss when hunkered down atop the bog.

The region is an essential habitat for breeding birds. The researchers found that the Flow Country hosted a startling 66% of Europe’s breeding greenshanks, 35% of the dunlin (Calidris alpina), and 17% of all European golden plovers. Divers – elegant, sharp-billed birds known as loons in the US – also raise families here: black-throated (Gavia arctica) and red-throated (Gavia stellata) divers nest among the small lakes of the blanket bog, often crossing the bog pools with young chicks on their backs.

But as plantations grew up, the conifers formed dense, impassable thickets. Predators began to move in – hooded crows (Corvus cornix), red foxes (Vulpes vulpes), pine martens (Martes martes), and others that birds of the bog had never encountered before. The danger zone stretched hundreds of metres around each plantation, eliminating potential nesting habitat for unknown numbers of dunlin, golden plover, and willow ptarmigan (Lagopus lagopus).

The new plantations brought other threats to the region’s native species. To prepare their land for timber, plantation owners ploughed up the bog, killing off the blanket of native plants that build peat and hold water on the landscape. Water drained away, eroding gullies and drying out the peat.

Lindsay, now head of environmental and conservation research at the University of East London, sees bogs as superorganisms in which the plants work together to manage the flow of water and keep the system healthy. “If you cut an artery in your leg, it’s a small wound but can have profound effects on you,” he says. “In the same way, cutting a small part of a bog can have profound impacts because its entire hydrology is connected.”

Armed with data from these scientific surveys, a group of advocates led by the Royal Society for the Protection of Birds (RSPB) and the Nature Conservancy Council launched a full-fledged battle to protect the Flow Country bogs. Finally, in 1988, after about 190,000 hectares (470,000 acres) of UK bogs had been drained and planted with trees, the government ended its financial incentives. By then, the Flow Country had been severely impacted. The RSPB acquired part of it – the 21,000-hectare (51,900-acre) Forsinard Flows reserve – in 1995. Within four years, an additional 146,000 hectares (360,800 acres) of Flow Country bog had been designated as a special protection area under the EU birds directive.

At that point, the anti-plantation movement was driven solely by conservation concerns – Lindsay and others were working to protect the peatlands’ native species. It would still be a few years before ecologists came to appreciate another trait of the bog: its ability to store tremendous amounts of carbon (although only if it’s healthy – and wet).

When bogs are drained, air exposure speeds up peat decomposition, causing the bogs to haemorrhage carbon into the atmosphere. “Peatland switches from a carbon sink in natural conditions to a carbon source in drained conditions,” says Roxane Andersen, a peatlands scientist at the University of Highlands and Islands in Thurso, Scotland. “Carbon that has taken thousands of years to accumulate could be released in much less time.”

Major farming regions in Europe and North America – including the midwestern corn belt and California’s Central Valley – lie on drained peatlands that have been spewing carbon for centuries. “You cannot see these emissions,” Joosten says. “A meadow with cows looks like a rich agricultural landscape. [But] this area emits the same amount of CO 2 per hectare as driving 135,000 km (83,885 miles) in a mid-size car.” He calculates that drained peatlands produce about 6% of all human-generated greenhouse-gas emissions. “That’s an enormous amount for a source that had not been recognised before,” he says.

Today, Scotland is pouring cash into eliminating the very forests that people were paid so generously to plant just decades earlier. The country has spent millions so far, including more than £10m for restoration work at the Forsinard Flows reserve. The Scottish government’s climate change plan aims to restore 250,000 hectares (617,800 acres) of peatland by 2030.

Because drained peatlands give off carbon 20 times faster than intact peatlands can sock it away, the priority during restoration efforts is to re-wet the ground. At remote forestry sites, the trees are often so small that it would cost more than the timber is worth to truck it away. In these cases, the felled trees are left to rot in the plough furrows.

Bog restoration takes time but today, 16 years after the restoration began, Andersen has found that a location within the Forsinard reserve known as Talaheel – one of the first sites to be forested and one of the first targeted for restoration in 1998 – has switched from carbon source to carbon sink, capturing about 60% as much carbon per hectare as the pristine control site. “Even though some of the plants growing there are not typical of undisturbed bog,” Andersen says, “on balance, they’re taking up more carbon than they release.” Now, with what she’s learned from Talaheel and other restoration sites, she believes that peatlands damaged by plantations can be transformed from carbon source to sink in fewer than 10 years.

As she nimbly picks her way across the recovering landscape, Andersen gazes at the mottled emerald and olive of the open bog. She sees hope for the ecosystem’s ability to adapt. “Peatlands have been around for such a long time, slowly but surely forming peat,” she says. “That suggests they’re intrinsically very resilient.”

If they can be restored to health, Andersen and other scientists believe that the peatlands will endure, even in a time of unprecedented change. Holding its secrets close, the bog hides a paradise for birds and beetles – and, deeper down, a vast stockpile of carbon we can’t afford to set free.

A longer version of this story was originally published on bioGraphic, an online magazine powered by the California Academy of Sciences.