The goal of a good compost pile is to turn dead plant material into humus, the black or brown material that is formed when organic matter is decomposed. Many organisms play a part in breaking down this organic matter, from microscopic bacteria, to fungi, to larger organisms like earthworms. Smaller compost piles may not have the volume needed to retain the heat necessary for heat-loving bacteria to make compost quickly, and may benefit from having larger decomposers present.

Besides earthworms, another valuable addition to a compost pile often comes naturally. The black soldier fly, Hermetia illucens, is a sleek looking fly that may be mistaken for a wasp. Unlike a wasp, they do not have a stinger and are harmless to humans. They are most commonly seen during the spring and fall, and may lay their eggs on any moist organic material. Livestock manure, dumpsters, and compost piles alike can attract these flies. Females will lay up to five hundred eggs in or near a source of food, and these hatch into larvae after several days. The larvae are voracious, chewing through organic matter steadily as they grow. All this eating lets them store up energy for the next phase of their life; after about two weeks, they pupate and become adults. Adults only live another week or so and do not eat during that time, relying on the stores they built up as larvae to keep them going until they can lay more eggs.

A compost pile will often attract these insects with no effort required on the part of the home gardener. They are very active and quite visible as they eat, and at times can be heard chewing and moving about. Allowed to do their work, black soldier fly larvae can eat more than their own body weight every day. If ten flies lay five hundred eggs each on a compost pile, the resulting larvae could chew through a pound or more of food a day. That adds up quickly as more flies find the pile!
When the larvae decide it’s time to pupate, they leave their food source and find a nice, dry sheltered area. Chickens love to eat the larvae, and compost bins can be set up to catch them as they climb out.
If you keep a compost pile, look out for these helpful flies. There should be no need to encourage them beyond adding material for them to eat, such as vegetable scraps, from time to time. Before long, they’ll chew through their food and leave rich, useful compost behind.
For more information see UF’s EDIS publication here: https://ask.ifas.ufl.edu/publication/IN830
To learn about building a composting bin designed to help harvest the larvae, see this publication from Purdue: https://extension.entm.purdue.edu/publications/E-276/E-276.html