The short answer is that the workers decide which egg(s) will develop into queen bees. There can only ever be one queen in a beehive. When a hive becomes overcrowded, the worker bees prepare a number of queen brood cells and the queen lays an egg in each cell. The workers then cover the egg with royal jelly. It is the jelly that makes the difference between the larva developing into a queen bee or a worker. Following
this the queen and about half of the worker bees leave the hive – this is a swarm – and look for a new place to form a hive. Back in the old hive, one of the queen cells breaks open and a new queen bee emerges. The new queen then searches out the other queen cells and stings them, killing the remaining developing queens. If two queens emerge at the same time, a fight ensues until one is dead. In a few days the new queen leaves the hive to find a mate, followed by the drones. Once the queen has mated she returns to her hive and will not leave again unless there is another swarm.
Answered by Dr Peter C Barnard, director of science, The Royal Entomological Society.