Spinach and beets are two of my favorite crops to grow in my relatively limited vegetable gardening space, but this year they just got infested with spinach leaf miners (probably because I have too little room to rotate crops and I grow them every year). I ended up getting very little spinach harvest, I hate those little things.
Leaf miner damage can often be confused for other problems. It can resemble to the uninitiated perhaps slug damage, or even a fungal infection. It is not these things. The key identifier of leaf miner damage is that the leaf is eaten on the inside, but the outside is fine, so you end up with a white wilty area on the leaf. You can also verify it by inspecting the bottom of the leaves and looking for little white eggs, usually in clusters of two or three.
The leaf miner is a species of insect, with the adult form like a small fly. They lay eggs on the undersides of certain species of plant (each species of insect has a preferred species of plant), the eggs hatch, the hatchling burrows into the leaf and then mines the inside of the leaf for food, leaving behind poop (the little black specs you then see inside the leaf) and not much else. For a leaf crop like spinach or chard, this obviously hurts. It even hurts for beets because we can eat those leaves too (and I do) and obviously losing leaves reduces plant vigor.
When full the larva, now like little grubs, tunnel out, drop into the soil, tunnel down, pupate, and emerge later as adult flies.
Controlling these pests is difficult. You can spray with neem oil, but it hardly works, and you have to get on the underside of the leaves, which is difficult. The main problem is the critter lives inside your plant, so topical sprays will no work unless you get it at that point of hatching. You can inspect all your plants to remove eggs before they hatch, but good luck with that. You can use floating row covers, but they need to be small enough to stop the small flies and they don’t help when the flies are emerging from soil at the plant’s base. It is almost the perfect pest, living inside your plant and then the soil directly underneath it.
The best controls are crop rotation and, if you have the time, daily inspections of your crop. When you spot the first signs of leaf miner damage, remove the leaf, and put it in a sealed garbage container (do not compost it, or the fly might just live). If you can, miraculously, cull an entire generation of leaf miners prior to them fully developing inside the leaves you might just save the harvest, but any leaf you remove will reduce the future population of the critters.
They overwinter in the soil, so intense cultivation in late fall and early spring may disrupt them there as well.
Spinach and beets/chard are related so they eat both plants, but they prefer spinach, and indeed this particular species in my garden is known as the spinach leaf miner. The interesting thing is, to me, that my beets seem to recover after I pull my spinach once it bolts in summer, the flies don’t seem to do as well with only beets to eat. Next year I plan to just not grow spinach, I will still grow beets. I will cultivate heavily in fall and spring, and I will try to be diligent about checking the leaves earlier for the first generation of these pests, and maybe reduce their population.