Flukes: trematodes and gill flukes

Monogenetic (Monogenean) Trematodes: Gill or Body Flukes. There are two families of self-fertilizing hermaphroditic trematodes employing "a single species" ("mono + genetic") as host in their life cycle: gill flukes and skin flukes.
When fishes "flash" against objects, yet you see no visible parasites, gill flukes (egg-laying Dactylogyrus) or body flukes (live-bearing Gyrodactylus) are among the likely suspects. Gills may become inflamed and swollen. Other, more advanced symptoms of flukes are clamped fins, inactivity, and rocking motions. Part of the host fishes' response to gill flukes is to secrete additional mucus. In bad infestations you might even see mucus trailing off the gills and you might misidentify a thread of mucus as a "gillworm." The physical abrasions that trematodes inflict can open the way for bacterial/fungal "finrot," even bacterial "gillrot" or body lesions.
The single-host, monogenetic trematodes are microscopic parasitic flatworms that cause irritation where their holdfast hooks dig into tender gill lamellae or the epidermis. Once they are securely attached, the flukes ingest tissues and fluids from the host while they reproduce themselves. Don't confuse them with the distantly related but harmless free-living turbellarian flatworms ("planarians") you might see on surfaces in the aquarium.
Doc Johnson's brief article on flukes at Koivet, notes that flukes can be the vector for bacterial diseases and recommends potassium permanganate or praziquantel. A few gill flukes do little damage, but too many of them can seriously weaken the host. You can see that it wouldn't take many flukes transferred from their parents to the gills of fry to cause inexplicable mass mortality in fishes that undertake parental care. Since fry are especially vulnerable to medictions, you'd do better to handle any gill fluke issues before spawning time.
Gill Flukes (Gyrodactylus) live as external parasites attached to the gills, where they're protected by the gill cover and are less likely to to swept off. But that's just what the fish is trying to do when it "flashes" against plants or gravel. Gyrodactylus is the type: it's less than a millimeter long.
Gill flukes produce eggs that drop away to hatch. The hatching time depends on temperature and can take two to four days. The hatchling is ciliated like a paramecium and has eyespots that enable it to swim away from light and find refuge under the fishes' gill cover. As the fish respires, the water-borne larvae manage to hook onto gills. Often only one or two fishes in a tank are carrying a heavy enough parasite load to be irritated. If the larva fails to find a host, it dies. But crowded tank conditions enhance the chances the larva will find a host. Once attached, it may take a week to mature and start producing eggs. The mature worm has a brief lifetime, perhaps a week.
Part of the host fishes' response is to secrete additional mucus. If there are many flukes, they can damage the gill lamellae, making them swell or even fuse together. A chronically affected fish gasps laboriously, perhaps with one gill closed and not functioning, but it is unlikely to die from gill flukes directly. Chronic infestation may cause the gill covers to stand permanently open, like a door left ajar.
Body flukes (Dactylogyrus), the other group of monogenetic trematodes, also microscopic, are live-bearing. They attach to the host's outer skin. They skip the egg and ciliated larval stages. Instead, embryos develop one inside another. The embryonic worms are shed fully formed, even already pregnant. They have developed their attachment hooks before they are shed, so Dactylogyrus can increase quickly to form a rather localized colony. One fish infects another through casual contact, which is why the affected fish in an aquarium may all be the same species. Bacterial infections may follow bad infestations.
Treating flukes. Flukes of either kind have dogged my steps all the years I've kept fish. For years they were best treated with Clout or Fluke-Tabs. The active ingredients in Fluke-Tabs are highly toxic organophosphates used as insecticides in agriculture. I only brought such powerful weaponry to bear because these parasites are multicellular animals, not single-celled protists. The action is fairly swift. If you were using an organophosphate, you'd stand prepared to do a 75% water change at the first signs the fish were stressed, especially with small tetras and the "scaleless" loaches. It may help to take out one-half the aquarium's water before you medicate, using a comparably reduced dosage. Other treatments often recommended have included salt baths, potassium permanganate, or formalin/malachite green medications.
Praziquantel. All these half-effective measures, which reduced fluke populations on my fish but never eliminated them, have been superceded now by praziquantel. Besides being much less toxic to fish, praziquantel remains active in the water long enough to eliminate the resistent eggs as they hatch. Follow the link at praziquantel above and read Dr. Erik Johnson's article on praziquantel.
Links. There is an article on the biology of trematodes at the U. of Florida's IFAS site.
Prophylaxis. A prophylactic treatment against flukes might be part of your normal quarantine procedure. Nowadays, praziquantel has become a standard part of my quarantine procedure for all new arrivals. If you're using the drip-bucket method for acclimatizing new fishes, it is very little extra trouble to add salt brine to make a short-term salt bath strong enough to eliminate trematodes. 
Digenetic or Digenean Trematodes: "Grubs" or Flukes. These form a separate and also entirely parasitic division of the flatworm phylum. Don't confuse them with the skin and gill flukes, which are monogenetic trematodes, or with the harmless free-living planarians you can see. Digenetic trematodes have complicated life-cycles that involve two ("di + genera")  —  or even four! — hosts in succession. Fishes play only one role in their parasitic lifestyles, either as an intermediate host or as the final host.
Digenetic trematodes aren't treatable. Fortunately they can't complete their full life cycle in the aquarium. Your pond-raised fish may arrive bringing encysted trematodes with them. Otherwise, the trematodes' entrance to the aquarium is through their first intermediate host. Generally this would be a pond-raised snail, but infected copepods might possibly come in with pond-raised plants. To become infected, the snails or copepods would have to come from an outdoor pool that is visited by fish-eating birds, such as kingfishers or herons.
Fish farmers are interested in protecting their stock from predation, though, and many outdoor fish farm pools are protected with heron nets. The adult parasite's eggs are passed out in the bird's feces, develop first in the snail, pass back into the water and then make their way through the fishes' epidermis. The fish doesn't have to eat the snail.
Once in the fish, the trematodes take one of two directions, depending on which taxonomic group they belong to. If the fish is their final host, they establish themselves in the intestine, where they can do a lot of damage and even block the intestinal passage of a small fish. The unlucky hosts of those digenetic trematodes don't survive long. If on the other hand a warm-blooded fish-eater is to be the final host, however, the flukes will encyst themselves (as "metacercariae") in the flesh of the fish.
There are three main kinds: Black grubs (Uvulifer spp. and their kin) form "black spot" cysts like pepper-grain pimples visible under the skin or in fin membranes or in the muscles. The minimal physical damage they do is over by the time the cysts have turned black. White grubs (Posthodiplostinum spp. etc.) encyst inside organs such as the kidneys, liver and heart, and you don't generally see them. The larger yellow grubs (Clinostomum spp. et al.) encyst in the muscle tissues, where you might have found them while filetting freshwater fish. I found an accessible and very informative USDA technical bulletin, a biologists' report on these trematode "grub" parasites: "Biology, prevention and effects of common grubs [digenetic trematodes] in freshwater fish".
So, that's why the randomly-scattered black pinhead-sized spots under the skin or the lumps you'll sometimes find embedded in the musculature of fishes that have been wild-caught or have been raised in outdoor ponds, will sometimes enclose a dormant curled-up worm (the cercaria in the metacercaria), ready to be released inside a fish-eating otter or bird — or a goldfish-swallowing bachelor-party jokester! As I said, none of these encysted metacercariae are susceptible to medication. But they won't spread in the infected fish either, nor infect other aquarium fish.
In aquaculture, ponds are periodically emptied, dried, and limed with quicklime to eliminate digenetic trematodes.