A hedgehog is any of the spiny mammals of the subfamily Erinaceinae, which is in order Erinaceomorpha. There are seventeen species of hedgehog in five genera, found through parts of Europe, Asia, Africa and New Zealand (by introduction). There are no hedgehogs native to Australia, and no living species native to the Americas. Hedgehogs share distant ancestry with shrews (family Soricidae), with gymnures possibly being the intermediate link, and have changed little over the last 15 million years. Like many of the first mammals, they have adapted to a nocturnal way of life. Hedgehogs' spiny protection resembles that of the unrelated rodent porcupines and monotreme echidnas.
A defense that all species of hedgehogs possess is the ability to roll into a tight ball, causing all of the spines to point outwards. However, its effectiveness depends on the number of spines, and since some of the desert hedgehogs evolved to carry less weight, they are much more likely to try to run away and sometimes even attack the intruder, trying to ram into the intruder with its spines; rolling up into a spiny ball is used by those species as a last resort. There are a different number of predators for different species: while forest hedgehogs have relatively few predators, primarily birds (especially owls) and ferrets, smaller species like the long-eared hedgehog are preyed on by foxes, wolves and mongooses.