Natural selection is the metaphor Charles Darwin used in 1859 to name the process he postulated to drive the adaptation of organisms to their environments and the origin of new species. Natural selection, together with the rules of inheritance discovered by Gregor Mendel at about the same time, stand at the basis of modern evolutionary biology. Before Darwin, naturalists had viewed differences among individual organisms within a species as uninteresting departures from their Platonic ideal or typus. Darwin, however, realized that since such differences can be heritable and affect the survival and reproductive output of individuals, variant traits that most enhance survival and reproduction may become more frequent over the generations. Darwin, moreover, had also to overcome the then dominant view that individual organisms can transmit to their progeny modifications elicited in them by environmental factors. In contrast, Darwin argued that adaptation is the result of the culling by nature of inheritable variation that arises without directionality.
The process of natural selection was first discovered by Darwin and later, independently, by Alfred Russel Wallace, but Darwin published his findings only in 1858 after Wallace shared similar views with him. Darwin and Wallace realized that natural selection had a special significance because it explained the evolution of the astounding ways in which organisms are adapted to their environments and the evolution of the millions of species known to exist and have existed on earth as well as why there are millions of species rather than a single one that does everything best.
Scientists today understand that not all evolutionary change must be driven by natural selection and that natural selection is not sufficient for evolutionary change to take place since not every trait that enhances reproduction needs to be heritable. In general, however, adaptive evolution requires natural selection because the possibility that favorable traits become more frequent across generations due to random fluctuations in trait occurrence, is negligible (see genetic drift). Favorable traits that owe their occurrence in a population to the fact that the genes encoding them became more frequent in the population over the generations through evolution by natural selection are called adaptations.
Differential reproduction due to natural selection can result from differences in functional performance at many levels of biological organization, not only at the level of individual organisms (see unit of selection), but historically the emphasis has been on the selection of individual organisms that differ in some trait(s) which affect individual performance and result in a higher or lower reproductive output (so called positive and negative selection). Elliott Sober in his book "The Nature of Selection" has stressed that natural selection can entail the differential reproduction of many things ("selection of") but that it is the cause of the differences in reproductive output what points to the target of selection and thus defines what the level and the unit of selection are.
As stated above, functional biological performance is what determines the reproductive output (fitness) of individual variants, i.e., whether a variant produces more or fewer progeny (and/or better- or lower-quality progeny) than others in a population. The major fitness components when talking about individual selection are viability (survival) and fecundity (progeny output).
Both the viability and fecundity components of fitness can have an ecological component and a sexual-selection component. The ecological component is determined by a variant's ability to negotiate environmental challenges not related directly to sexual competition (such as the ability to gather food, to fend off or avoid predators, and so forth). The sexual-selection component is determined by a variant's ability to perform in the at times highly elaborated rituals that determine an individual's success at attracting mates and prevailing at such against other individuals of the same sex, which can be a major factor influencing fecundity (and more rarely viability). Because of sexual selection's dire potential to affect total fitness, it is not surprising that evolution by sexual selection has led to traits that are clearly maladaptive from the point of view of ecological performance (a famous example being the tails of male peacocks, which are very important in wooing females during courtship but are obviously detrimental to locomotion).
Natural selection is distinguished from artificial selection which refers to the evolution of domesticated species as a result of human culling rather than culling by the "natural environment". However, the mechanisms of natural and artificial selection are essentially identical, and in fact outstanding cases of evolution by artificial selection like the diversity of dog and pigeon breeds were used by Darwin to illustrate how the process of selection can result in evolution.
The modern theory of evolution by natural selection states that genetic differences between individuals can result in differences in functionally relevant traits, in higher reproduction of the individuals endowed with the better traits, in preferential transmission to the next generation of the genes encoding the traits that result in higher reproduction, and thus in changes in the frequency in successive generations of these genes and of the traits that individuals display.
Although natural selection is often called the mechanism of evolution, the generation of heritable phenotypic diversity is also crucial since without it selection cannot result in adaptive evolution. Such variation is now understood to be generated by the shuffling of genetic material (crossing over) that occurs during meiosis and syngamy, by random alterations of the genetic material like point mutations, insertions, and deletions, and by the insertion and deletion of self-replicating genetic elements like tranposons as well as of viruses that integrate their genomes in that of their hosts.