Sometimes for a species, the environmental conditions change so drastically that their survival becomes difficult. For example, if the temperature of water increases suddenly, most of the bacteria living in that water would die. Only few variants resistant to heat would be able to survive. If these variants were not there, then the entire species of bacteria would have been destroyed. Thus, these variants help in the survival of the species.
However, not all variations are useful. Therefore, these are not necessarily beneficial for the individual organisms.