Apple Cider Vinegar works as a fruit fly trap, as it is made from fermented apples. Fruit flies are attracted to the smell of fermenting and rotting fruit so that they can lay their eggs.
The fruit fly is the adult stage of the insect. A vinegar trap is designed to capitalise on their instinct at this life stage to find a suitable place to lay their eggs. The effect can be increased by heating the vinegar first to enhance the scent. The fly may be trapped either by a funnel arrangement that only allows the insect in, or by combining dish detergent with the vinegar. This will break the surface tension of the vinegar so that the fly will drown.