(Bear with me here as I try to find the words to explain what I’m asking about- IANAGeneticist).
I was wondering if there are any known examples of a population of organisms that have the following feature: the population has two competing forms of a gene; one form is, in the short run, more advantageous than the other. But in the long term, having too high a percentage of the population with that allele undermines the conditions that made it successful in the first place; the organisms with that version of the allele suffer a population crash, and the alternate form of the allele becomes predominant. Then the first version builds up again, and so forth. In other words, rather than having the two versions reach a steady state, or have one or the other become extinct through selection or genetic drift, the ratio between the two will continually oscillate. Or to put it another way, the two alleles are in a sort of “tortoise and hare” contest, with one version suffering boom/bust cycles while the other remains steadier.
You’ve nearly somewhat summarized several chapters from the book (which I heartily recommend) The Red Queen by Matt Ridley.
The Red Queen says that the parasites (whether bacterial or worms) and their hosts have a range of genes which dictate their effectiveness at their role (being a parasite/getting rid of the parasites). So instead of just two alleles there’d be 10 or 20 or 30 or whatever the situation which fluctuate constantly between generations – hosts who have the genes that counter the parasite’s advantages will thrive. Then the parasites who aren’t countered will thrive, pushing out the ones who are countered…and then, in the next generation, the hosts who have some different counter will thrive, etc. Everyone is constantly changing their genetic locks and immune systems but everything pretty much stays the same – hence the Red Queen allusion.
Another idea from that is the reason there is sex at all is the fact that sexual creatures are better at changing to combat the parasites or hosts (parasites are often sexual too, of course) than asexual creatures in certain situations (there are still environments where asexual is better).
An extension of the above, although I don’t know if it counts for your OP technically, are species that are asexual for long periods of time but under certain conditions will take the opportunity to make males in order to reproduce sexually. And then poof, the males will die off and it’s back to 100% asexuality.
How about three alleles ? I recall reading about a lizard ( I think in the previously mentioned Red Queen’s Race ), about a species of lizard whose males come in three different colors, and three different mating strategies. The first type is very aggressive and territorial towards other males, and collect large harems. The second variety is unaggressive towards other males, but sneaks in and mates with the females when the first type isn’t looking, and eventually outbreeds it. At that point the third type has an advantage; it’s moderately aggressive and keeps small harems that it can keep an eye on, and therefore shuts out the second type. Once the third type dominates, they have their harems stolen by the more aggressive first type, and the cycle starts over. It’s paper-scissors-stone for lizards.
Whoops, it is The Red Queen like mstay said; I misremembered the title. No wonder I couldn’t find it to read again ! < scampers off to library >