A compost pile is the bio-degradation of organic materials, such as kitchen and plant wastes, which is used in treating and improving garden soil. Materials like coffee grounds and filters, egg shells, discarded vegetables, cardboard, newspaper and tea bags slowly decompose in piles or bins, which can attract a variety of insects. These insects aid in the decomposition of the organic materials, and also add to the nutrients with their own excretions.
Fruit flies usually infest compost bins that are newly established and that contain wet kitchen waste. Also known as vinegar flies, the fruit flies burrow into the decaying vegetable or fruit material where they lay their eggs. Once the fruit flies have laid their eggs and the compost decays more, their eggs hatch into maggots that eat the remaining solid material. The maggots excrete waste into the compost that makes up of digested organic materials like fruit and vegetable skins and fruit fly fecal matter. Once any kitchen waste is completely broken down and decayed, the fruit flies go away.
Black Soldier Flies
Black Soldier flies, unlike common houseflies, only live approximately 36 hours in adult form and are rarely seen indoors. The Black Soldier fly is attracted to decaying flesh and other pungent rotting materials, in which to lay their eggs. The black soldier fly larvae are easily identifiable as fat, meaty black maggots that grow to about an inch in length and are blackish brown in color. The maggots are ordinarily only found in compost piles that have meat in them, which is to be avoided unless it is a worm composting bin.
Carabid, or ground, beetles are common beetles. They are large in size, measuring up to two inches in length and they can be found in compost piles where they eat any and all types of meat waste. They also eat the other insects that thrive in compost bins and piles. They shouldn't be bothered in a garden environment, because they especially eat pestilent insects like caterpillars, aphids and fruit flies.