The survival strategies of some species can seem counter intuitive to us until we examine them in detail. Take bees for example; bees die after stinging once, because the stinger tears out their insides. How did this self-destructive trait evolve?
The answer is found in the way bees reproduce. In evolutionary terms, a "successful" organism is one that passes on its genes - not necessarily one that lives a long life. In human beings, the best way to pass on genes is through your children. That means the advantage goes to the person who stays alive longest, reproduces most, and defends his or her children best. But there is another way to pass on genes: through your siblings. After all, your brother or sister has SOME of the same genes you do, because you share the same parents. So if he or she survives, that much of you survives too.
In bees, this is actually a better strategy than having offspring. Only one out of thousands of female bees becomes queen; all the others are sterile. However, the sterile female bees are 75% genetically identical to each other. The result? For a bee, dying in order to defend the hive means a much better chance of your own genes surviving - in the form of all your sisters.
Why have insects such as wasps NOT evolved to pull out their insides when they sting, then? The answer may lie in the size of the hive. The gene-passing strategy we have described only works if, by dying, you protect a large number of copies of yourself. In smaller hives where this is not the case, it then becomes important once again for the individual to survive.