Chromosomes
Each bee has a genome made up of 13 "chromosomes". Each chromosome represents a characteristic where "Species" is one of the characteristics. (For a full breakdown of the genome see
http://forestry.sengir.net/wiki/index.php?n=Beebreeding.Main#Genetics) Each chromsome is again made up of two "alleles". One allele is primary, one is secondary (0 - 1).
Alleles
Each allele contains information on a characteristic. I.e. you can have a chromosome 0 that represents "Meadows-Meadows", meaning that the primary allele is Meadows and the secondary Meadows as well. You can also have a chromosome 9 "Cave dwelling - Not cave dwelling". Any combination of those two genes is possible without regard to recessesive or dominant. You can have a "Diligent-Meadows" chromosome, even though Diligent is recessive and Meadows is dominant.
However, only one of the two alleles will be active and actually affect the bee. If the characteristics on both alleles are dominant or both are recessive, the active allele will always be the primary. If the primary allele is recessive and the secondary dominant though, the secondary will override the primary and become the active allele. (There is an exception for some very rare bee effects which can actually be kind of "co-dominant", but I'll not spoil that.
)
Inheritance
Now, when a queen dies and a new princess/drone is spawned the following occurs:
Parent 1: Meadows-Meadows (pure Meadows), Parent 2: Forest-Diligent
On spawning the new bee, Forestry will at random choose one allele of Parent 1 and one allele of Parent 2 and recombine them as a new chromosome for the offspring. The above example can thus lead to:
Meadows-Forest (active: Meadows), Forest-Meadows (active Forest), a Meadows-Diligent (active: Meadows) or a Diligent-Meadows (active: Meadows; Diligent is recessive!) bee.
Mutation
Only on the species chromosome there is another quirk: "Mutation" to simulate a kind of evolution. Certain combinations of bee species have a chance to yield a new one. The combination Meadows-Forest is one of those and can yield the Common allele with a pretty high chance. Before Forestry chooses a new allele for the offspring from the two randomly chosen alleles of the parents, it will compare them and if there is a mutation and if that mutation wins the dice roll, the resulting allele will not be one of the origin alleles, but rather the mutated one.
This adds the following possible outcomes to our above example: Common-Diligent (active: Common), Diligent-Common (active: Common; again, Diligent is recessive!), Meadows-Common (active: Meadows) and Common-Meadows (active: Common). Note that Forest-Common is not a possibility since its single allele is always required by the Common mutation.
(Note: That's off the top of my head, I am pretty sure I got the example right, but I haven't looked at the code in a while.)