I recently read an interesting New York Times article about how evolutionary biologists have finally cracked the "tetrodotoxin mystery." Tetrodotoxin is a wildly effective neurotoxin which is found in puffer fish (although hopefully not in the famous fugu dish made from their flesh), as well as in some newts, a few species of frog, a poisonous octopus, and a species of crab. But how does the same, relatively exotic, neurotoxin evolve in the bloodstream of so many divergent animals?
Tetrodotoxin works on the sodium channel in a nerve cell, and it turns out that this channel is not always the same shape across the animal kingdom, or even across individuals in a particular species. The shape of the tetrodotoxin molecule blocks the sodium channel in most animals, causing them to experience almost instant death. Other animals have evolved the ability to let the tetrodotoxin molecule pass, thereby becoming immune to it.
Presumably this evolved as a quirk mutation, in much the same way that a very small percentage of any given population (if it's large enough) will be immune to any given poison. We see this with germs and pest insects all the time, in the pejorative sense. Think MRSA, or cockroaches! But it's important to remember that this immunity statistic is actually to the benefit of the animal involved.
Researchers furthermore found that pufferfish raised in a completely sterile environment are not poisonous, and the same goes for the otherwise poisonous newts. Their poison, then, is thought to be the result of a bacterial infection to which they are immune. This is a fascinating example of symbiosis: the bacteria get to live and pass on their genetic material, and the animals get to be incredibly poisonous.
It makes me wonder if a similar mechanism is involved in the mystery of spider venom. A spider's venom is about a thousand times more deadly than it needs to be, for the kind of prey that it consumes. At the same time, with very few exceptions (like the brown recluse, black widow, and hobo spider), it is not toxic enough to seriously damage a predator.
Venom is expensive to maintain, from a biological perspective. Being this venomous is the equivalent of walking around with an RPG launcher strapped to your back all the time. It's ridiculously overpowered, and it takes a lot of your strength to haul it around. If you were going to walk around wearing an RPG launcher, you would have to have a pretty good reason for it! In the case of spider venom, we don't really know what that reason is, but clearly there must be one.
Incidentally, if you have heard that "the daddy longlegs is the most poisonous animal in the world, but its mouth is too small to bite humans," this is untrue in three or four different ways. Not least of which being the difference between something that's poisonous (which means to the touch, or if you eat it) and something that's venomous (which injects venom when it bites or stings you).
