Hamilton’s Rule, also known as Kin Selection, is a evolutionary strategy theorized by William Donald Hamilton in 1964. It was originally used to understand altruistic behaviors seen in eusocial populations such as insect colonies. In these colonies, most of the females are sterile, but they work to support the reproductive efforts of the queen. These females aren’t producing offspring and passing on their own genes, so they would be considered less ‘fit’ in a conventional evolutionary sense.
Hamilton instead thought of evolution on the scale of the allele, rather than the scale of the individual. This way, if an individual assists a close relative so that the relative has a better chance of reproductive sucess, the individual would be ensuring that copies of it’s same alleles would be passed on through the progeny of its relative.
Hamilton worked this all out in the deceptively simple equation
C/B < r
which basically just says that an individual is more likely to risk its own survival to help a relative if the relative is a close uncle or sibling rather than a cousin twice removed.
Here is a short video of W.D. Hamilton explaining the evolution of altruistic behavior.