When a bee hive under goes certain conditions, like over crowded, or a weak queen, the hive decides to create new queens by feeding the larva extra royal jelly. All bee larva are fed some, but future queens get more.
Then the hive will split some will leave with the (old?) Queen in search of a new home, the rest will remain with the hive. A swarm is a stage where the bees wait outside of the old hive in search of a new home.
Latest Answers