Tarantulas have earned a deadly reputation as a predator capable of killing mice, lizards and small birds.

But the spiders are known to run in fear from a giant insect.

The tarantula hawk wasp preys on its namesake, engaging in a ferocious battle that leads to the spider being paralysed with a highly painful sting.

Females of the species take on tarantulas because their size makes them a perfect meal for the wasp’s larger than average offspring.

Tarantula hawk wasps have to drag the sleeping spider – which can be up to eight times their weight – to a burrow, lay an egg on the tarantula and seal up the tunnel. The young wasp devours the tarantula in order to develop into an adult, eating the non-essential organs first to keep it alive for as long as possible.

The deadly fight between spider and wasp is shown on the BBC Two programme Nature’s Weirdest Events.

“Rather surprisingly the spider doesn’t present any real danger to the wasp," says Dr Justin Schmidt, entomologist from the Southwestern Biological Institute.

“Wasps almost never get killed by a tarantula – at best, maybe one wasp in a hundred is seriously injured or killed.”

But the spiders flee in terror at the sight of a wasp, their usual threat display of rearing up and baring their fangs failing to have an effect on these females.

The pain is beyond imagination

The pain inflicted by a tarantula hawk’s sting has been rated by Dr Schmidt as one of the worst in the insect world. He created the Schmidt sting pain index as a pain scale of all insect stings.

“A sting feels like a lightning bolt struck the spot; the pain is beyond imagination,” he says.

“Fortunately, it lasts only about two to three minutes. It rates a four on the pain scale and is unsurpassed in intensity by any other stinging insect.”

He says the pain is only beaten by that caused after a sting from a bullet ant, because that pain lasts between 12-24 hours.

Gender selection

Tarantula hawks have not only worked out how to successfully attack a predatory spider but also to reserve the best meals for their most valuable offspring.

The wasps are able to decide the sex of their baby by choosing whether to fertilise the egg or not, fertilised eggs produce females while males come from unfertilised eggs.

Unlike females males do not have to find and battle tarantulas, they simply seek flowers and a mate and as a result they are not required to grow as large as females. Mother tarantula hawks therefore give their biggest catches to female young, keeping smaller spiders for males.

As nectar-eaters female tarantula hawks do not normally need to be aggressive, only using their stings to defend themselves, so the question remains how their ancestors first worked out they had the power to take on a tarantula and win.

“Currently this highly evolved behaviour presents little risk to the wasp,” says Dr Schmidt.

“But what about the first wasps to attack spiders – the wasps needed to learn (and survive) the skill, and the spider presumably would not be so timid and might view these first wasps as dinner.”

You can follow BBC Earth on Facebook, Twitter and Instagram.