This process is called natural selection.
With that said, it means that the organisms with the less favorable traits to the environment had a less chance of surviving and they are less likely to pass their characteristics to the next generation as they have a lower chance of reproducing.
For example, there are black moths and white moths. The black moths can camouflage themselves in the dark environment, meanwhile the white ones can be easily spot by predators. Therefore, the number of white moths decreases because predators caught them. The leads to more black moths around and less white ones.