Organisms who are better-adapted to a habitat are c more likely to survive and reproduce, thus increasing the the proportion of those individuals in a population.
This process is called natural selection. Over time natural selection can result into a population specializing to form a