Pest and Diseases Image Library, forestryimages.org
What makes this interesting though, is the strange and unusual, and maybe unique, way in which these beetles determine their gender.
First a little about gender determination: in most mammals this depends on the X and Y chromosomes and all species are diploid (that is, they all have pairs of chromosomes in their cells, all apart from one set. In female mammals there are always two X chromosomes, paired up like any other set. In males, however, there is one X and one Y chromosome, of which the Y is small.
During egg and sperm production, these pairs of chromosomes are shared out, one of each pair to each egg or sperm respectively so, all eggs, produced by females who only have X chromosomes, will all have just one X chromosome, that is, they are haploid. Sperm produced by males however, will either have an X or a Y chromosome.
During fertilization the chromosomes from a sperm are transferred to the egg to produce the complete normal number of chromosomes again. Depending on whether the sperm had an X or a Y chromosome, the resulting embryo will either be male or female.
For more detail on gender determination, see this article.
So, in mammals and many other animals and plants, gender is determined genetically.
In some insects, plants and animals, however, rather than the presence or absence of one or other of a pair of chromosomes, gender is determined by the presence or absence of a complete set of chromosomes. In many social insects of the hymenoptera order, such as wasps, bees and ants, and in some coleopterans (beetles), all males are haploid (that is they only have one of each chromosome). Females, on the other hand are diploid (that is they have two, in pairs). In these insects, the fertilised female keeps a store of sperms and can 'choose' to fertilise an egg, or not. Unfertilised eggs become males and fertilised eggs become females. This means, of course, that in these species males have no fathers!
Now, where does our boring little beetle fit into all this?
Well, as with several other related beetles, X. ferrugineus gender depends on whether they are haploid or diploid. To produce a diploid female the egg needs to be fertilised by a sperm from a male. However, and this is the magic bit, to produce a male, the egg ALSO needs to be fertilised, though not with a sperm but with a bacterium!
So, male X. ferrugineus all develop from 'bad' eggs and the bacteria live in their developing bodies and are passed to the females along with normal sperm during mating.
So what we have here is an example of parasitism having progressed to symbiosis when both sets of genes have an 'interest' in the same outcome. The genes of both the host and the parasite form a cooperative alliance because both benefit from it. The beetle gets the benefits of sexual reproduction, with gene shuffling, etc, and the bacterium gets a free ride and all the nutrients it wants.
And of course this is possible because, at the basic level, evolution takes place in genes. Where alliances are beneficial to genes, or any other replicators like memes, for that matter, these alliances are to be expected.
For another example of this see my blog Unintelligent Design - Forming Alliances. Plenty of other gene alliances can be found in nature. For example, look how many copies of wild jungle fowl genes can now be found in domestic hens following their alliance with humans. How many sheep would there be now had humans never formed an alliance with them? And what of wheat and other cereal crops which now form vast prairies in some parts of the world?
More pertinent to the human story maybe is to wonder how many humans would there be today had we never formed alliances with wheat, rice, maize, barley, horses, cattle, pigs, etc, etc, etc.
And of course, the wider lesson from nature from the 'selfish gene' is how very often cooperation results in great advantage to both members of the alliance. Indeed, life itself depends on replicators, or genes, forming alliances with other genes even at the simplest prokaryote cell level. At the higher cell level, alliances of prokaryote cells formed eukaryote cells. These in turn formed multicellular organisms which in many cases formed social groups, and societies. And, especially in humans, in alliance with those other replicators, memes, multicellular life formed cooperative groups, social systems, nation states and cooperative national groups like the European Union.
By contrast, competition between genes and especially between alliances of genes, is frequently harmful to both, especially when it results in arms races.
None of this makes any sense as the work of an intelligent designer of course. Why would a single designer come up with so many different ways to determining gender, and why have genders in the first place when parthenogenesis would be so much simpler?
From the perspective of 'selfish' genes, there is no problem at all and no magic involved, though some might find the result magical indeed.
What a wonderful world.