To the uninitiated there are two types of ants in the UK: the red ones that bite and black ants which invade our kitchens. Even more alarming is when hundreds of local ant colonies swarm and create a regional “flying ant day”.

People can develop an intense fear of ants called myrmecophobia. Although this is more likely to happen if they are allergic to ant bites and stings.

The ant scuttling across my kitchen floor this morning would, to most people, simply be a black ant and a nuisance, but it’s my favourite species. Small, with a short waist between thorax and abdomen, I identified it as Lasius niger (the black garden ant). This is Britain’s most common ant species, just one of 51 that live in the UK, plus 13 introduced species.

Worldwide there are about 16,000 ant species in colonies of up to 500,000 individuals. They can all bite (though most are too small to hurt) some sting, and all produce formic acid for protection and attack. That all sounds a bit worrying if you’re not an insect person.

What use are ants?

Anyone who has been bitten by an ant may wonder what the point of the bothersome little creatures is. But the truth is we simply couldn’t do without them.

Ants help to break down organic matter. Without them it would accumulate, reducing soil quality. Studies on weaver ants Oecophylla smaragdina demonstrate they reduce pests and can improve crop yield. Some people eat weaver ants as they are high in protein and fatty acids.

Ants tunnel and build underground nests. As ecosystem engineers they improve soil porosity to air and water, increasing pH and vital soil nutrients. The wildlife we love to watch from our gardens or in nature reserves depends on ants. They are eaten by green woodpeckers, for example. Larvae of the endangered large blue butterfly also feed on red ant larvae.

All ants live in a highly structured community. They share information and collectively make decisions. Most ants are workers, produced from fertilised eggs. They have different roles according to age; deep in the nest caring for larvae when young, then cleaning and transporting food, and finally scouting and collecting food when older (and more dispensible). Some tropical ant species have soldiers for defence and attack, which like workers are all female. UK wood ants (Formica rufa) don’t have soldiers so workers take on the role. Formica sanguinea raid colonies of Formica fusca and take larvae that grow up to become their slaves.

Some species such as Lasius niger establish themselves in houses, and I tracked my ant to a colony that was hollowing out the pantry wall (now repaired). Not harmful to humans in itself, each L. niger has a specific job, and mine was a scout. It would return a food sample to the colony. Other ants would follow the scout ant to the food source. L niger  scouts lay chemical trails to bring its sisters to food.

When the colony becomes too large, the queen produces winged ants. They are fertile princesses which develop from fertilised eggs, and males from unfertilised eggs. Swarms are triggered by warm, humid conditions after rain. Flying ants use their wings only once.

Swarming encourages genetic mixing as males from other nests chase each princess. The males then die from exhaustion and damage inflicted during mating. New queens shed their wings and start a nest of female workers. The old queen stays and can live for 25 years. All her young come from one nuptial flight, though she may mate with several males.

Not all red ants sting

Another common species is Myrmica rubra, a red ant sometimes called the European fire ant. Common across the UK and Europe, it has invaded North America and AsiaM. rubra is aggressive and if provoked, it bites and often stings. M. rubra forms mounds or lives under stones in grassland or sand dunes. As it searches for food it can disrupt a picnic, but it rarely ventures indoors. A lot of people think of red ants as bad ants.

One study investigated the differences in behaviour of both species by providing them, one at a time, with a route to a container of springtails (tiny wingless insects eaten by ants).

Although M. rubra on average spent a third less time in the chamber than L. niger, it made three times as many aggressive contacts with the springtails, and killed almost seven times as many. So, M. rubra is more predatory, but living in exposed places is at a greater risk of attack. You can hardly blame it for defending itself. L. niger is too small to inflict a painful bite and has no sting.

Most ants don’t harm us, unless we threaten them. Although they can damage crops. Red ants, for instance, could destroy your allotment (they keep aphids as pets to feed on their sugary secretions).

So they may invade your house, steal your food and damage your vegetable patch. But the majority of British ants lead blameless lives underground as architects of soil health in complex societies.

This article originally appeared in The Conversation.

Christopher Terrell Nield is a lecturer in Bioscience at Nottingham Trent University.