In normal conditions (left panel) Drosophila females prefer to lay their eggs in food that does not contain ethanol. However, when they cohabit with endoparasitoid wasps, they start to prefer to lay their eggs in food that contains ethanol, as this protects against the parasite. This switch in behavior is accompanied by decreased expression of neuropeptide F (NPF) in the brain and germcell apoptosis (middle panel). The adults hatched from these eggs (right panel) also prefer to lay eggs in food with ethanol and have reduced NPF levels in the brain, even though they have never been exposed to the wasps. The behavioral switch is maintained for up to five generations (not shown). F1: First filial generation. F2: Second filial generation.