This is lightly paraphrased from the BBC's report on an article in Nature. I'd be interested to see anyone explain this in terms of evolution or natural selection...

The larva of the parasitic wasp Hymenopimecis sp. will eventually eat its host spider - but not before it has injected a behaviour-bending chemical that makes the spider construct a special scaffold. This design, which is quite different from the spider's normal fly-trap, has the strength to support the pupating wasp.

The spider, Plesiometa argyra, is doomed from the moment it is stung in the mouth by the adult female wasp. This paralyses the spider and allows the wasp to lay an egg on the arachnid's abdomen. When the spider recovers it goes about its daily business of web weaving and feeding, unaware that it has become a meal for the developing larva now hatched and clinging to its body.

The larva will make small holes in the spider's abdomen through which it can suck the creature's haemolymph, a task made easier by the apparent introduction of an anti-coagulant that prevents the circulatory fluid from clotting too quickly. When this blood does eventually clot, it makes a large scab that acts as a saddle from which the larva can hang and reach for its next meal.

Finally, on the evening of the day that it will kill the spider, the larva induces the spider to spin this unusual web from which it will hang its cocoon. The design is unique - the spider will not build anything similar during its normal life. When the wasp somehow senses that the construction is finished, it will kill and start to eat the spider. This happens more or less at midnight and lasts until about midday.

It will then drop the spider's empty body to the ground and sit in this special web until the next evening when it begins to build a cocoon.