Since we are on the subject of fruit flies, let me rehearse that insect's short, sweet life.
Like ourselves, a fruit fly begins life as a mother's egg fertilized by a father's sperm. Within a day, the egg hatches to produce a tiny larva, or maggot. The larva typically feeds upon yeasts that it finds in rotting fruit -- a compost bin is perfect! Six days and a few molts later the larva seals itself up in a hard brown capsule, or pupal case. It remains in this enclosure for four days, during which time almost all of the larval organs dissolve into a soupy mix from which the organs of the mature fly form. When the transformation is complete, the adult fly inflates a little bag on its head which forces open a trap door in the pupal case.
The fruit fly generally emerges from the pupal case in the early morning (Drosophila means "dew lover"). Good timing is essential. The earlier out, the easier it is to be successful in the competition for mates. There is no advantage to emerging in darkness when a mate can't be seen, and fatal to emerge in the heat of midday with delicate wet skin. A genetically programmed chemical "clock" ticks in Drosophila's brain. The clock is set in the embryonic stage by changes in temperature and light. When the "alarm clock" signals that the time is right, out pops Drosophila.
Now comes the moment of truth. A male fruit fly follows a prospective mate and vibrates its wings to produce an exotic "love song" of clicks and whirrs. The song is amazingly species specific, and genetically determined. Even geneticists can't tell some species of Drosophila apart except by their song. If the pitch or rhythm is not just right, the female immediately terminates the courtship.
If the female responds, then a little foreplay begins while the male continues to vibrate. Copulation follows, which can last as long as 15 minutes. From then on it's all down hill; the female lays her hundreds of fertilized eggs and the cycle begins again.
Fruit flies are wonderfully prolific. They can produce 25 generations in a year. Let's assume that a female lays 100 eggs, half male and half female. These hatch, develop into mature adults, mate, and each of the 50 new females lays 100 eggs, half male and half female. And so on. In the absence of any natural checks on the growth of population, within 25 generations a single pair of fruit flies would give rise to enough progeny to fill a ball the size of the Earth's orbit! No wonder our compost bin teems with flies.