The key point to recognize is that a particular variant of a trait needs to already exist in the population before the change occurs. The majority of individuals may not have that trait, so a random sampling, such as Chilodonella described, would be more likely to miss that variant among all the other individuals without it. And, of course that variant needs to NOT be detrimental prior to the change in climate, habitat, etc., so that it continues to exist among enough individuals even if just in a very low percentage of the population. When the conditions change, the individuals without that trait simply die off because they are unfit, and those with the variant trait become the predominant proportion of that population because they can survive that change.
So, just to reiterate, in evolution, a trait must exist BEFORE the environmental change, it is not acquired after the environmental change or in response to the environmental change. Instead, those "lucky" individuals that had it before the environmental change will be the remaining survivors when everyone else dies off because they don't have the right traits.
As an example, just look at the variations in humans for a trait such as body hair in men (harder to tell in women because they go to great lengths to remove most of it). You'll notice that there are men who have almost no body hair or facial hair, or it's very fine, and at the other end of the spectrum, there are those covered from head to toe in thick mats of body hair. Humans are able to modify our environment to suit our own needs, so we see all these variants thriving equally well among our population, and there's no particular advantage or disadvantage to having more or less body hair (other than perhaps a bit of "eww" factor regarding very hairy backs at the beach). But, should we become more vulnerable to the outside environment without the protection of heating and air-conditioning, we may see that shifts in temperature up or down would alter the survival rates of men with or without hair, making one more favored than the other in the population. I'll note that this isn't an ideal example, because that body hair doesn't develop until puberty, so children still need to be able to survive to adulthood without the hair, and could father a child before succumbing to the deleterious effects of their body hair if such a selection happened, but it's just a fairly accessible example of a trait where you can easily observe a wide range of variation in the natural population without having to think of someone as a "mutant."