Natural selection is a theory originally popularized by Charles Darwin. According to this theory, animals in the natural environment change over time as beneficial traits are preserved, and traits which do not advance the species are slowly weeded out. People sometimes confuse this theory with evolution; in fact, it is just one component of the modern evolutionary synthesis which explains how species evolve and change over time.
According to Darwin's theory, published in 1859 in the The Origin of Species, given any animal population, a wide variety of traits may be present. If an animal develops a trait which helps it to survive, it will be more likely to pass the trait on to future generations, eventually resulting in the widespread appearance of that trait as successive generations breed. This could potentially result in the emergence of an entirely new species over time.
One classic example of natural selection is the peppered moth in England. When the Industrial Revolution occurred, huge amounts of coal and other particulates entered the air, turning the trees around some factories black. White peppered moths stood out starkly against the tree trunks, making them easy targets for birds, while darker moths were able to remain concealed, passing on the genes for dark coloration to future generations because they lived long enough to breed. Eventually, the population became primarily dark, and this process was reversed when England started instituting clean air standards, reducing pollution and allowing the trees to return to a more natural hue which favored pale moths.
Darwin compared natural selection to the artificial selection demonstrated by humans when they breed plants and animals for beneficial traits. Although Darwin did not understand genetics, he knew that people like horse breeders were able to bring out the best traits in successive generations of animals, and that a similar process must be occurring in nature.
One of the major issues with natural selection as a standalone theory is that it would imply that species should become homogeneous over time as animals with positive traits dominated the gene pool. As demonstrated by the immense diversity in most species, this is not the case, because of things like genetic drift and spontaneous mutations, which ensure that the gene pool does not become too simplistic.
While Darwin's theory alone was not sufficient to explain the process of evolution, it laid the groundwork, and 20th century scientists built on it in the 1930s to come up with a more complete series of interconnected theories of inheritance. Natural selection can be seen at work on a variety of levels, from the development of antibiotic-resistant bacteria to color variations in flowers which live in different environments.