Above crumpled grey roots like the enormous feet of a prehistoric elephant, leaves form a vaulted roof as grand as a cathedral. Huge limbs stretch out for 24 metres on each side. They smell damp. Stand beneath "the Tree", as this magical old beech is known to anyone who walks this corner of the Chilterns, and you feel in the presence of something living and breathing. Its trunk is polished smooth from admirers who have scrambled into its embrace, and it has even brought its charisma and great girth to bear on films such as Harry Potter and the Goblet of Fire. This tree has lived for 400 years but now it is dying. Green summer weeds sprout on the ground below its huge canopy, sunlight now penetrating its thinning head of leafy hair. "The tree isn't capturing all the light that it once did," explains Bob Davis, head forester for the National Trust's 5,000-acre estate at Ashridge. "It is slowly shutting down. We've decided not to do any surgery on it and allow it to decline naturally into senescence."

In its dotage, this great tree is being carefully nurtured. Across the country, however, many of our estimated 100,000 ancient trees – which could represent 70% of all ancient trees in Europe – are neglected or at risk of being felled. This week, they get a new guardian: Brian Muelaner, a forester turned conservationist, is to count all the ancient trees on land belonging to the National Trust, which could turn out to be the largest private owner of ancient and notable trees in northern Europe. Muelaner's new job as the Trust's ancient tree officer will help push along the Ancient Tree Hunt, a five-year project led by the Woodland Trust, which for the first time is recording every ancient tree in Britain. "If we don't know where they are, we can't protect them," says Muelaner. "If we can't protect them, we don't know if they can survive."

A tree is defined as ancient if it is unusually old for its species. It is said that an oak spends 300 years growing, 300 years living and 300 years dying. Such a long-lived species would have to be 600 years old to be classified as ancient. Beeches are prone to fungal attack and are less long-lived: an ancient beech is anything over 300 years old. Birch trees have even shorter lives; one that has lived for two centuries is very old.

Ancient trees are ecological treasures because they provide unique habitats for rare plants, insects, birds and mammals. When they become ancient, trees such as oaks and sweet chestnuts "grow down", dying at the top and forming a new crown of leaves below so the tree shrinks and hunches like a very old man. Ancient trees also hollow out: fungi feed on the deadwood in the heart of the tree and invertebrates such as rare beetles move into the hollows, followed by birds and bats. Three-quarters of our 17 species of bat are known to roost in trees. Some plant species can only survive on ancient trees: over time, the pH of bark changes and certain rare lichens only grow on ancient bark.

With a laughing Buddha around his neck, Muelaner looks like a hippie rock star, but he is not a tree-hugger. "That doesn't do it for me, but I understand it," he says. "The mood an ancient tree puts you in, it just takes your breath away; you know you are by something extremely important and significant. When you are under an ancient tree, it's very good for your soul." He compares a century-old beech nearby the 400-year-old tree. "It's like the difference between an 80-year-old man who is full of knowledge and experience and a cocksure 15-year-old who thinks he knows everything. You can discard those people as doddery old folks or you could use them for their knowledge. You can learn so much from ancient trees about how a tree survives. How does an organism survive for 1,000 years in the same spot? It doesn't get to move to a better position. So it adapts."

Standing beneath the huge old beech, contemplating its warty imperfections and huge stretch-marks where its trunk has bent and twisted, it seems incredible that it has stood witness to four centuries of humans scurrying around it. While this example partly owes its long life to being pollarded by humans over the centuries (the traditional way of harvesting its branches at head height, pollarding mimics the natural retrenchment of trees such as oaks, and ensures species like beech don't grow too tall and fragile), trees have their own clever ways of prolonging their life. They can eat themselves. When fungus attacks the dead heartwood, a tree might send aerial roots into the hollow and start drawing the nutrients out, recycling itself so it lives longer. Trees can also walk. Slowly. If a branch touches the ground, it can send out roots and grow up again.

Our wealth of long-lived trees is a happy accident: a legacy of our royal hunting forests, our domineering aristocracy and our lack of efficiency – compared with our north European neighbours – in harvesting our forests for timber. The last century, however, has not been kind to ancient trees. We have ploughed too close to them, grazed too intensively around them and used fertilisers and pesticides too wantonly, killing both trees and species of fungi that have a symbiotic relationship with them. Then there was the ripping out of native broad-leaved trees and planting of supposedly more productive non-native conifers after the second world war. "The Forestry Commission, the National Trust, private landowners, everyone was guilty in its day. There was a national drive for it," says Muelaner. "Now we know the unique historical, cultural and biological importance of these trees, and there is a national movement to reverse the bad management of the past."

Trees may be impressively long-lived but they are more fragile than we imagine. Too many livestock sheltering under a tree and defecating there can fatally damage it. Even a footpath under a tree can compress its roots and destroy it. One day, Davis discovered a group of druids worshipping the great beech at Ashridge with a small fire. The tree did not look as if it had been harmed but even a mild scorching – with no visible damage – can cause a tree's sap to boil and kill it. Ancient trees are often hollow: the holes make fantastic dens but children often light small fires in them. "You lose your ancient tree just like that," Muelaner snaps his fingers. "We do things inadvertently and it's gone. We can't put it back. We can't recreate that habitat like we can with grassland. If we kill an ancient tree, we have to wait 500 years to restore that habitat."

Trees can also die of sunburn. Close to the great beech at Ashridge, another beech is dying because a vast branch of another tree fell nearby, exposing this tree to the sun. Beech has thin bark and, just like a pale-skinned human, if it has grown up protected from the sun and is suddenly exposed, it burns horribly. Grey squirrels stripping bark is an increasing problem: holes in the bark allow fungal diseases in, which can weaken a tree and finally cause it to fall over. Fungal diseases introduced by squirrels also stain the quality beech wood that the Chilterns is renowned for, making it commercially worthless. "It's a serious economic and ecological issue. It's a total disaster," says Muelaner.

Ancient trees are not merely great statues to biodiversity, they document human history; they have a social and cultural significance, as well as an ecological one. The ancient trunk pictured at the top of this article bears the scars of decades of graffiti. "It is vandalism but then it becomes historic," he says. During the second world war, American soldiers shot deer, chased local women and prepared for war in the woods at Ashridge. On 4 May 1944, a few weeks before D-Day, when many young men would perish, a group of GIs carved a "V" for victory and the names of their home states – from Texas to South Dakota – into the trunk of another Chiltern beech nearby. It is still there, a memorial in bark, the carving slowly fattening as the tree grows so you can rest a finger in the V now.

Muelaner, whose post has been funded for three years by the Cadbury family, will accelerate the process of logging our ancient trees. So far, the Woodland Trust has logged 38,000 ancient trees through the work of ecologists and ordinary members of the public, who can record trees at ancient-tree-hunt.org.uk. Our great wealth of ancient trees may not remain unknown for much longer, but they are still relatively unprotected. Other countries preserve ancient trees by listing them like an old house or ancient monument. In Britain, the only protection is a tree preservation order, which can be circumvented by developers if it is proved trees are dead, dying or dangerous (and most ancient trees, by definition, are dying: it just takes them three centuries).

Muelaner points to the enormous beech at Ashridge. "If France, Germany or the Scandinavian countries had a tree like that, there would be plaques everywhere and it would be a national monument," he says. As well as better protection, he believes we need to create ancient tree-like habitat by planting young trees such as birches that age quickly and provide dead wood or by deliberately maiming some trees to create hollows and dead areas so beloved of smaller living things.

"The speed of our societies nowadays mean that trees are that much more important to us as places where we are grounded and are at peace," says Muelaner. "We need them now more than we ever needed them before".