Kin selection
From the time of antiquity field biologists have observed that some organisms tend to exhibit strategies that favor the reproductive success of their relatives, even at a cost to their own survival and/or reproduction. The classic example is a eusocial insect colony, with sterile females acting as workers to assist their mother in the production of additional offspring. Many evolutionary biologists explain this by the theory of kin selection.
The concept was formalized by JBS Haldane (1955) and W. D. Hamilton (1963), while the actual term "kin selection" may first have been coined by John Maynard Smith (1964) when he wrote "These processes I will call kin selection and group selection respectively. Kin selection has been discussed by Haldane and by Hamilton. ... By kin selection I mean the evolution of characteristics which favour the survival of close relatives of the affected individual, by processes which do not require any discontinuities in the population breeding structure."
Kin selection refers to changes in gene frequency across generations that are driven at least in part by interactions between related individuals, and this forms much of the conceptual basis of the theory of social evolution. Indeed, some cases of evolution by natural selection can only be understood by considering how biological relatives influence one another's fitness. Under natural selection, a gene encoding a trait that enhances the fitness of each individual carrying it should increase in frequency within the population; and conversely, a gene that lowers the individual fitness of its carriers should be eliminated. However, a gene that prompts behaviour which enhances the fitness of relatives but lowers that of the individual displaying the behavior, may nonetheless increase in frequency, because relatives often carry the same gene; this is the fundamental principle behind the theory of kin selection. According to the theory, the enhanced fitness of relatives can at times more than compensate for the fitness loss incurred by the individuals displaying the behaviour. As such, this is a special case of a more general model, called "inclusive fitness" (in that inclusive fitness refers simply to gene copies in other individuals, without requiring that they be kin).

# Hamilton's rule
Formally, such genes should increase in frequency when
where
This inequality is known as Hamilton's rule after W. D. Hamilton who published, in 1964, the first formal quantitative treatment of kin selection to deal with the evolution of apparently altruistic acts. The phrase Kin selection, however, was coined by John Maynard Smith.
In the 1930s J.B.S. Haldane had full grasp of the basic quantities and considerations that play a role in kin selection. He famously said that, "I would lay down my life for two brothers or eight cousins". Kin altruism is the term for altruistic behaviour whose evolution is supposed to have been driven by kin selection.
Haldane's remark alluded to the fact that if an individual loses its life to save two siblings, four nephews, or eight cousins, it is a "fair deal" in evolutionary terms, as siblings are on average 50% identical by descent, nephews 25%, and cousins 12.5% (in a diploid population that is randomly mating and previously outbred). But Haldane also joked that he would truly die only to save more than one identical set of twins or more than two full siblings.

# Mechanisms
Hamilton (1964) outlined two ways in which kin selection altruism could be favoured.
Firstly, if individuals have the capacity to recognize kin (kin recognition) and to adjust their behaviour on the basis of kinship (kin discrimination), then the average relatedness of the recipients of altruism could be high enough for this to be favoured. Because of the facultative nature of this mechanism, it is generally regarded that kin recognition and discrimination are unimportant except among 'higher' forms of life (although there is some evidence for this mechanism among protozoa). A special case of the kin recognition/discrimination mechanism is the hypothetical 'green beard', where a gene for social behaviour also causes a distinctive phenotype that can be recognised by other carriers of the gene. Hamilton's discussion of greenbeard altruism serves as an illustration that relatedness is a matter of genetic similarity and that this similarity is not necessarily caused by genealogical closeness (kinship).
Secondly, even indiscriminate altruism may be favoured in so-called viscous populations, i.e. those characterized by low rates or short ranges of dispersal. Here, social partners are typically genealogically-close kin, and so altruism may be able to flourish even in the absence of kin recognition and kin discrimination faculties. This suggests a rather general explanation for altruism.  Directional selection will always favor those with higher rates of fecundity within a certain population.  Social individuals can often ensure the survival their own kin by participating in, and following the rules of a group.

# Examples
Social insects are an excellent example of organisms that display presumed kin selected traits. The workers of some species are sterile, a trait that would not occur if individual selection was the only process at work. The relatedness coefficient r is abnormally high between the worker sisters in a colony of Hymenoptera due to haplodiploidy, and Hamilton's rule is presumed to be satisfied because the benefits in fitness for the workers are believed to exceed the costs in terms of lost reproductive opportunity, though this has never been demonstrated empirically. There are competing hypotheses, as well, which may also explain the evolution of social behavior in such organisms (see Eusociality).
Alarm calls in ground squirrels are another example. While they may alert others of the same species to danger, they draw attention to the caller and expose it to increased risk of predation. Paul Sherman, of Cornell University, studied the alarm calls of ground squirrels. He observed that they occurred most frequently when the caller had relatives nearby.
Alan Krakauer of University of California, Berkeley has studied kin selection in the courtship behavior of wild turkeys. Like a teenager helping her older sister prepare for prom night, a subordinate turkey may help his dominant brother put on an impressive team display that is only of direct benefit to the dominant member.
Recent studies provide evidence that even certain plants can recognize and respond to kinship ties. Using sea rocket for her experiments, Susan Dudley at McMaster University in Canada compared the growth patterns of unrelated plants sharing a pot to plants from the same clone. She found that unrelated plants competed for soil nutrients by aggressive root growth. This did not occur with sibling plants.