Is this where natural selection kicks in? The organism which can speed up mutation survives to reproduce?
Yes.
There is a rather amusing analogy here with how some bacteria can swim towards light. Some bacteria have flagella that can beat in two different modes. In one mode, the bacterium tends to move in a straight line. In the other mode, the bacterium tends to "tumble" in place.
The bacterium alternates between these two modes, tumbling, and then moving in some direction, then tumbling again, and so on. The direction of movement after tumbling appears to be completely random. How then do they manage to swim towards the light?
Basically, the length of time between tumbles increases when the light level is low.
This means that in low light levels, each straightline movement is longer, and moves it further. In high light levels, the straightline movements are quite short. In either case, the movement is a random walk, but when it is dark the walk tends to cover longer distances, which increases the chance of moving out from the dark regions. When it is in the light, it tends to remain in that vicinity. If it happens to move deeper into darkness; tough. They played the odds and lost.
In an analogous fashion, a bacterium in a stressful environment may replicate with less accuracy, leading to larger "steps" within the genome space. Essentially, it is not where it wants to be, and plays the odds in the "hope" that its daughter bacteria end up into a better position.
None of this is thought out by a bacterium. The chemistry in both cases can be studied. It is complex organic chemistry, but no additional control is applied other than normal chemistry. The selection for changes in the chemistry controlling replication, or flagellum beating, will tend to mean that the survivors in each generation are those that took larger steps in bad circumstances.
Cheers -- Sylas