Insect colonies such as ant and bee colonies was a biological puzzle for quite a while because of what looked like altruism which is not adaptive. If you take honey bees as an example, typically there's only two individuals who reproduce, the queen and her male sperm donor. From that perspective only, the worker bees seem very altruistic, working hard to keep the queen satisfied while not reproducing themselves .. doesn't sound like it could evolve.
It wasn't until one understood and took into account inclusive fitness and the genetic relationship between the bees that it finally made sense. Traditionally, kids learn that having a high fitness is adaptive and that you gain that by reproducing, but it's not entirely correct. You gain a higher fitness when your genes are replicated, but not necessarily from your own reproduction. In a beehive, the bees are so genetically related that each worker bee gains a benefit to her own fitness from servicing the queen, helping her make them more sisters.
The reason they're so related is bee males are haploid and have only one set of genes which is always passed on. All his sperm contain the same genetics. When the male fertilizes the queen's eggs, she gets diploid female offspring which becomes worker bees. Because the only genetic variability between sisters comes from the queen, worker bees are so closely related that they share ~75% of their genes on average. Sisters themselves are more related to eachother than they would be to their own offspring would they have them (~50%). Because of that, it becomes adaptive for any worker bee to help the queen make her more sisters rather than getting her own offspring.
.. I think it's quite interesting