Cobra venom acts largely through alpha-neurotoxins that bind the nicotinic acetylcholine receptor at the neuromuscular junction, paralysing the victim. Mongooses carry amino acid substitutions in that receptor which reduce the toxin's ability to bind. The same trick appears independently in other venom-exposed animals, including the honey badger and the hedgehog, a striking case of molecular convergence.
Resistance is a margin, not a shield. Mongooses can be killed by cobra bites, particularly by large snakes delivering full envenomation. What actually determines the outcome of an encounter is behaviour: the mongoose provokes repeated strikes, dodges them, exploits its thick coarse fur and loose skin, and closes when the snake is tiring to bite the back of the head.
The reputation has had consequences. Mongooses introduced deliberately to control snakes and rats on islands, notably the small Indian mongoose released in Hawaii, the Caribbean and Fiji, instead devastated native birds, reptiles and amphibians and became one of the more damaging invasive mammals on record. The Indian grey mongoose is also poached for hair used in paintbrushes, despite legal protection, and the scale of that trade is not well measured.

