Consider the following paragraph by Darwin in The descent of man (chapter 5):
With savages, the weak in body or mind are soon eliminated; and those that survive commonly exhibit a vigorous state of health. We civilised men, on the other hand, do our utmost to check the process of elimination; we build asylums for the imbecile, the maimed, and the sick; we institute poor-laws; and our medical men exert their utmost skill to save the life of every one to the last moment. There is reason to believe that vaccination has preserved thousands, who from a weak constitution would formerly have succumbed to small-pox. Thus the weak members of civilised societies propagate their kind. No one who has attended to the breeding of domestic animals will doubt that this must be highly injurious to the race of man.
It seems incredible that, after a lifetime devoted almost exclusively to meditate on his theory of evolution, Darwin made the mistake of applying it wrongly to humans, as is clearly demonstrated in the paragraph I have just quoted.
Biological evolution is the result of the complex interaction of four factors:
1. The genetic variability of organisms, which in turn is the result of the interaction of their genes with a huge set of external and internal factors: natural or artificial radiation, chemical substances, gene shuffling by sexual reproduction, etc. These factors are often unpredictable or unknown, therefore they are usually considered the result of chance.
2. The environment, also subject to variations that, in the whole, can be considered random.
3. Natural selection, which is essentially the observation that individuals better adapted to their environment are more likely to leave offspring. Despite its probabilistic nature, this factor of evolution is often considered virtually deterministic. In Jacques Monod’s formulation , it represents necessity.
4. The basic rules of the game (the physical laws governing the universe). Depending on what laws we are talking about, this component can be considered part of chance (quantum mechanics) or of necessity (general relativity).
According to Darwin's theory, a biological species may be well adapted to its environment, but if the latter changes (we have seen that those changes can be random), such adaptation may be lost, in which case the species in question could suddenly become maladjusted, and even extinct.
Many years ago I wrote these two paragraphs in a popular science book :
Advances in medical science have made it possible that many human beings (those whom heredity or genetic variability has provided with deleterious genes, leading to disease or to physical weakness) do not die in childhood, as happened before, but reach maturity and leave offspring, thus perpetuating their "harmful" genes, which gradually spread to an increasing number of individuals. Some people wonder if future mankind will have so many genetic defects in its normal complement that humans will only be able to stay alive artificially, relying entirely on the means of medicine.
It is questionable whether this situation is really worrying. All that this means is just that man has adapted to a different self-made environment. Genes that would have been lethal in other conditions, in the new circumstances are indifferent or even beneficial. The laws of evolution and natural selection are still operating. Only the environment has changed.
Darwin's mistake was believing that natural selection acts independently of the environment. How else could he think that the same genetic characteristics that made savages adaptable to their environment should remain favorable when applied to civilized societies? That the weak can now survive and are able to reproduce only means that these individuals are now well adapted to their environment.
A very different question is what would happen if a natural or provoked catastrophe made it impossible to maintain our artificial environment. Would the human species become extinct? It is possible, but in that case it would be due, as in many other cases of extinction, to a simple change of environment. But that is another story.
 Jacques Monod, Le hasard et la nécessité, 1970. Chance and necessity, 1971.
 Manuel Alfonseca, La vida en otros mundos, Alhambra, 1982; MacGraw Hill, 1993.