The process of oviposition in Dolichomitus imperator: 1 Tapping with her antennae the wasp listens for the vibrations that indicate a host is present; 2 With the longer ovipositor, the wasp drills a hole through the bark; 3 The wasp inserts the ovipositor into the cavity which contains the host larva; 4 Making corrections; 5 and 6 Depositing eggs.
An ovipositor is the long hollow tube on the rear of female insects (and some other animals). Through this tube they lay eggs. The ovipositor is formed by the union of three pairs of rear appendages.
In many species it is a piercing organ which allows the insect to put its eggs into a specific place. In some species of wasp, the female drills through tree bark with her ovipositor and lays eggs in the bodies of grubs eating under the bark. However, in many hymenoptera the ovipositor is used as a sting, and the female does not use it for egg-laying.
Wikimedia Commons has media related to Ovipositor.