Kin selection

Kin selection or kin altruism is a form of natural selection. Some animals cooperate with relatives, even if this brings risk to themselves. The classic example of this is seen in the family life of mammals, or in colonial insects such as ants. 
Many mammals and birds raise alarms to warn others of danger. Others cooperate in tasks, such as scrub jays help each other with to build nests. In all these cases where animals cooperate, the question is whether there is any biological benefit to themselves. It is now clear that there is benefit if the animals are closely related. This is because related organisms have (to a degree) a shared genetic inheritance.
The first to write about the concept were by R.A. Fisher in 1930, and J.B.S. Haldane in 1955, but it was W.D. Hamilton who truly formalized the concept. The actual term "kin selection" was probably coined by John Maynard Smith, when he wrote: 
By cooperating, relatives influence each other's fitness. Under natural selection, a gene which improves the fitness of individuals will increase in frequency. A gene which lowers the fitness of individuals will become rare. 
However, behaviour which enhances the fitness of relatives but lowers that of the actor, may nonetheless increase in frequency. Relatives do, by definition, carry many of the same genes. This is the fundamental principle behind the theory of kin selection. According to the theory, the enhanced fitness of relatives may more than compensate for the fitness loss of the helpers (individuals displaying the behaviour). 
This is a special case of a more general model, called inclusive fitness.
Hamilton's equation.
Hamilton's equation describes whether or not a gene for helping behaviour will spread in a population. The gene will spread if rxb is greater than c:
where: