They are a member of the wasp family. They lay their eggs in fly eggs. There are several places to get them and they are advertised in many horse magazines. Fly traps help too. A good system of traps with effective bait will trap many thousands of adult flies, thus cutting down on the next generation, and keeping the little buggers off your horses.
Horses can also pull shoes by catching the heels on something and yanking off the shoe.
Roots, wire fences, rocks and the like are common causes. A horse can pull a shoe this way while you are riding, and also when turned out. If you continually find shoes in the same place in a pasture, there is likely something near by that the horses are catching the shoes on and ripping them off. Remove that object and the problem will go away. If this continually happens when riding in a certain area, perhaps you shouldn't ride there, or be more careful about picking your route.