Parasites live off a host but coexist with it. Parasitoids spend part of their life cycle attached to but eventually kill the host. Parasitoids consume their host, usually before it can reproduce. Parasitoids are used in biological control of pests.
In the fisrt example, a cabbage white (Pieris rapae) caterpillar has two parasitoids. A Pteromalid wasp (Pteromalus puparum) and a Tachinid fly (Compsilura concinnata?) laid eggs in it before it pupated. Then after hatching, the larvae of the parasitoids consumed the host while in the pupal state. The hole in the pupa is where the parasitoids emerged. The fly larvae then created the puparium. The wasp larvae(?) fell out of the cabbage white pupa. Some of the wasp larvae pupated and emerged as adult wasps.
In the second example, the aphid mummies are all that remain with a hole in them where a parasitic wasp emerged. Likely a Braconid Wasp, Subfamily Aphidiinae, known for feeding on aphids.
All images © Kim Moore (contact for use)