this is an example of natural selection
the peppered moth
moths in england before the industrial revolution were mostly white so that the blended in with the trees. After the revolution, soot made all the trees black, so the few moths that were black survived and passed their black genes on whilst the white ones died and couldn't pass their white genes on. If the moths didn't have the black colour gene they would have eventually become extinct.
organisms become extinct because they cannot survive in their environment (though bear in mind that man has played a big part in the extinction of many species)