From Sciencs:
Royalty has its privileges, even in the insect world. Queen honey bees can choose the sex of their offspring, a new study shows. Like a sharp stinger, that finding pokes a hole in the notion that queens are merely mindless egg layers and that worker bees have the final say on whether the queen lays eggs that give rise to males or females.
Every young queen goes on a mating flight and then stores the sperm she collects from multiple matings for the rest of her life, using it up bit by bit as she lays eggs. Males, called drones, emerge from unfertilized eggs, and females emerge from fertilized ones and become the workers. So if the queen adds sperm to an egg, it will produce a female; if she withholds sperm, the egg will produce a male. That would appear to give the queen control over the sex of her offspring. However, the dogma among entomologists is that workers control the type of eggs the queen lays. The workers build the cavities, known as cells, in which the queen will lay her eggs. A queen will lay an unfertilized egg in a particular cell only if the cell is big enough to accommodate a male larva, which is bigger than a female one. So by controlling how many cells they build of each size, the workers can limit how many male offspring the queen produces.
More here.