The environment determines which variations are beneficial. Individuals with traits that are well-suited to the environment are more likely to survive and reproduce, while those with less favorable traits may not survive as well.