ยง Evolution of bee colonies (WIP)

This kind of culture that beehives have is called as 'eusociality'. I'm interested in this because I want to understand what alien societies might look like, and what selection pressures are required to have bee-like societies evolve. Many sci-fi books (Ender's game for example) depict aliens with such a society, but tend to be hazy on how this state of affairs came to be.