Maggots are not necessary to maintain a composting pile, but according to SFGate, it is possible for them to infest compost. Maggots are good composters, and there are a number of benefits to having them in a refuse pile.
Maggots eat all types of food and vegetable waste, including things like grease that are otherwise very difficult to compost. Additionally, maggots excrete chemicals that kill bacteria and neutralize bad smells coming from the compost pile. One major drawback of maggots in a composting pile is that eventually the maggots grow into bothersome flies; however, if the composting pile is outdoors, the flies normally disperse naturally and avoid swarming around populated areas.