Whilst there are actually many types of "worms" - the badger is actually something of a connoisseur, preferring one particular type of earthworm known as "LUMBRICUS TERRESTRIS"! This is common in most gardens, fields and deciduous woodlands, but uncommon in coniferous forests or woods, due to the very acidic soil.
However, earthworms are present in all areas of the UK; and, in certain soils, present in a very high density. This is especially apparent on damp nights when the worms emerge from their underground burrows to breed.
In short grass, worms can be seen in huge numbers; and the badgers can swarm across the grassland simply "hoovering" them up in an obsessive frenzy. In a single night, perhaps as many as 200 worms can be eaten by each badger. On the face of things worms are easy to catch - especially in grass which has been cropped short by grazing cows or sheep (or a lawnmower in your garden), but the worms do have one trick up their sleeve. Worms are sensitive to vibration, and will rush to return down their burrows if they sense heavy rain or heavy footsteps. In trying to make an escape, they might get half way down their burrow, before the badger decides to suck them up. In trying to get the whole worm, the badger can end up making round or oval-shaped snuffle-holes with its snout.
The short grass beloved by gardeners can be a pretty direct cause of badger damage. If badgers forage on the lawn, the short grass makes it easier for the worms to come out in greater numbers; and therefore easier for the badgers to find. The larger number of worms encourages the badgers to return to what is a great feeding location; which concentrates the damage they do on that lawn. Letting the grass grow long will reduce the damage caused by badgers, but this is not something all gardeners want to do.
To be balanced against the damage done by badgers when foraging for earthworms, is the large number of snails they eat. They will happily crunch through these in significant quantities; and it is often possible to see snail shells in badger droppings. Snails, of course, are generally disliked by gardeners; so badgers do provide significant garden benefits - even if the balance sometimes goes against them.
There are two main risk factors with badgers having such a high reliance on earthworms in their diet.
The first one is dependence - in other words - if there are no earthworms for a few days, badgers are at a higher risk of starving or dehydration. This can happen in long, hot, dry summers, when the worms either do not come above ground, or find it too difficult to emerge because of baked hard soil. It can also happen in long, frozen winters, when the worms remain underground beneath a rock-hard layer of frozen top-soil. In either case, feeding badgers sloppy wet cat food will help badgers survive through these tricky periods. Wintertime is especially risky, as there will be limited opportunities to forage successfully for other foods too. If you wish to help at these times, see feeding hints.
The second risk factor is infection. Worms, slugs and snails can harbour internal parasites, which then pass into the badgers intestines once they eat the worms. Healthy badgers (like many wild animals) can tolerate a certain number of internal and external parasites, but large numbers of tapeworms, fleas, ticks and lice can hamper a very young or poorly badger, so it can not grow or return to full health.
Even with the risks of dependency and infection, earthworms still provide a vital food source. One good nights feeding on earthworms, can give a badger as much protein as about a kilo of best beef. Consequently, badgers who eat earthworms tend to be bigger and stronger than those that don't. There is also anecdotal evidence that badgers have more territorial battles (with other badger clans) involving grassland rich in earthworms.
In the UK, a vivid yellow crop called Oil-Seed Rape is grown. As well as its alarming yellow colour, the roots of this crop give off a gas that kills or deters earthworms from being in the soil. This has a knock-on effect for badgers, meaning they are forced to forage for earthworms or other food in other areas or risk dying from starvation. Be warned, if your local farmer has just replanted his lush green grass meadow with oil seed rape, badgers will come looking for worms elsewhere (like your lawn, the local park, golf courses, etc).
Some people believe that badgers can catch Bovine Tuberculosis (i.e. TB from cattle) because they eat earthworms. This argument (which remains unproven), is that TB is present in the soil or animal dung, which is then ingested by the earthworm. The earthworm, is then eaten by the badger (along with the TB-infected soil), and provides a heightened risk of the badger getting TB.
Because Oil-Seed Rape acts as a worm deterrent, it will also have the effect of forcing badgers into other earthworm-rich areas - such as cattle pasture. If those areas have higher levels of soil-based TB-bacteria (for example, from infected slurry or from dung from infected cattle); it has been suggested that this might pose an increased risk of TB transmission. As is commonly the case with bovine TB, more research is needed.
A measure of the importance of earthworms to the diet of badgers is that, in a study of badgers in the South West of England, 75% of badgers had earthworms in their stomacchs, and 65% had ONLY earthworms in their stomachs.