Insects and fruit flies get tempted by the food in your compost bin and make their way over to get a taste for themselves. This usually happens when the food is close to the surface. Adding dampened cardboard or newspaper on the top can help keep these insects at bay.