Social bees are amazing insects that have evolved to each have their own role in the colony, with the queen at the heart of the operation.
This is similar to how ants and termites function, but unlike them, bees can actually turn on their very own queen who brought them into the world if they become too old or diseased to serve the colony.
This occurs when worker bees detect that the queen's pheremone output diminishes, giving a clear indication that a replacement needs to be found in order for the colony to survive.
The worker bees rebel against their queen only when a new queen is available to take the reins. Unfortunately for the ailing queen bee, rebellious workers begin to smother her by forming a ball using their own bodies around her, where she will eventually succumb to overheating (and probably take a few of them with her!)
The way in which they smother and kill the queen is the same method that the bees employ against larger predatory insects, such as wasps and hornets who threaten and prey on the bees.
The process of replacing an old queen with a new one is called supersedure, which beekeepers can force by clipping the queen bee's legs, preventing her from properly laying her eggs.