We had one hive for a few years. They are amazing. Apparently our hive was healthy, because it split every year. We'd worry that the whole hive was swarming away, and then realize half were still in the hive. Loved having bees. The honey was a tasty bonus.
Then the ungrateful bitches left.
They 'swarm' when they're hive becomes too crowded or does not have the resources to support it. They do this by creating a few 'Queen' cells to replace the leaving Queen.
When the time is right, they abscond with their Queen and leave behind a few nurse bees and a whole lot of brood in the brood box. When they hatch, they then start the cycle all over again with a new Queen.
The best way to prevent a swarm is to divide the hive, crush the queen cells, and then introduced a new queen to the new hive, one that has been mated and is ready to lay eggs!
You then have two strong hives instead of one overcrowded one.