I know there is alot about this i do not know, but what i have learned is this:
You can tell alot about what is going on in a hive by the placement of queen cells.
1. A few well placed cells on the a frame of brood...not many in a hive is known as a supercedure cell. More than likely the workers realize their queen is failing in one way or another. Berfore the new queen starts to "pip" the workers kill the old queen, or the new queen will kill the old one if the workers did not. Once the new queen emergers, she goes around the frames and kills any queens in the cell. She does this by listening to the other cells "pipping", locates them and kills them before they emerge. Then the workers clean them up.
2. Cells and many of them along the top or along the bottom is an indication of swarming. And once this starts, a hive really stops working for the benifit of the hive and goes into a swarm mode. The old queen departs once she hears the "pipping from the new queen cells. Again if the queen can not fly, she and the virgin duke it out. Rarely does a swarm queen kill the other queen cells, thus you end up with "after swarms"
3. The last type of queen cell formation is still a supercedure formation, along the face of the frame, but it looks like a "bunch of Grapes". This is an indication of emergency supercedure. Basically the workers realize too late that the queen failed and race to make cells. When this is noted, look for disease, age of the old queen, some sort of problem in the hive. This queen in my experience rarely lasts long since the hive is somehow compromised. It is best to assess the hiive for soundness...maybe the queen died of old age...and make a decision on what to do. Either re queen with a good queen or shake out and let the healthy bees find a new home, or combine...not a fan of combining if i do not know the health of the hive. And lastly treat if i feel the hive has a good chance to make it. But the decision on what to to should be based on the health of the hive.
One of the things i have noted, is that a hive that is compromised rarely takes a new queen that we have introduced. I have had better success by introducing a frame of fresh eggs and larva. However that seems redundant when a hive is sick. I am of the opinion that if it can not survive on it's own with the hive maintence i do, then chuck it (shake out the bees and let the healthy find a new home..exception is AFB) and start again. I am not the type the keeps poor genetics...costly IMO.
These are my observations. Others might note other hive reasons and why it happens.