Wasps in the genus Pepsis lay their eggs in a specific region on a species of tarantula and their larvae eat the tarantula organs in a specific sequence to keep it alive as long as possible.
How could this process have evolved, considering that a mistake at any stage results in death?
This is the description of the egg laying behaviour:
Upon finding a tarantula, the wasp locks its mandibles onto a foreleg and brings its stinger into position so as to paralyze it.
During this process, the tarantula tries unsuccessfully to dislodge the wasp, but the wasp ultimately locates the right part of the tarantula in which to insert its stinger.
Upon inserting it, the wasp injects a venom that paralyzes the tarantula. Note that the tarantula is ten times the weight of the wasp, so the wasp takes very big risk in trying to attack such a tarantula.
The wasp then drags the tarantula into a hole that it has already dug. It pulls the tarantula down into the hole, attaches its egg to a specific part of the tarantula's body and then covers up the hole so that predators won't find it.
When the egg hatches, the larva eats the organs of the tarantula in a specific sequence so as to keep the tarantula alive for several weeks. Eating in the wrong sequence results in the death of the tarantula, and its subsequent putrefaction, which means the death of the wasp larva.
When the larva successfully eats in the right sequence, it is able to obtain enough nourishment to prepare for metamorphosis, ultimately resulting in a full-grown wasp, which then exits the hole and becomes a predatory wasp.
These wasps are solitary, which means there are no conspecifics to teach the new wasp how to do all this. Thus, the entire behavioral program described above must be encoded in the wasp's genome.
The description above is based on:
Punzo, F. (2005). Experience affects hunting behavior of the wasp, Pepsis mildei Stål (Hymenoptera: Pompilidae). Entomologica Americana, 113(3), 222-229.
Petrunkevitch, A. (1952). The spider and the wasp. Scientific American, 187(2), 20-23.