The Cape Bee females have this quality to them, that allows them to go against the rule of their own queens, and take over other hives. This renegade action would normally be a problem, as the workers in one hive would recognize this intruder and exterminate them, but for some reason the Cape Bee is able to make it's way into the position of queen. How it does this, is in it's genes.
The Cape Bee, while it has a very similar genome to normal honey bees, it has a few specific differences. One of which allows for the Cape Bee to reproduce asexually. This is done by the queen laying a pre-fertilized egg, which is created by the fusing of 2 of her eggs. This eliminates the purpose of having a mate, which allows the new queen to parasite her way into a new hive without notice. This is called social parasitism, and is only used by this bee because its genes let it disguise itself as a member of the same colony, while also giving it the ability to reproduce asexually.