Imagine that some organisms find themselves in an environment in which they can no longer survive or reproduce. Their only hope of salvation is that a lucky mutation will crop up and enable them to deal with their adverse circumstances. If mutation rates are low, which they usually are, the chances that any will survive are slim. But if they have mechanisms that kick in in stressful conditions and increase the rate of mutation throughout the genome, things might be better.Many individuals will perish quickly (they get mutations that make matters worst), but the chances that one or two will have a liberating mutation are enhanced.
The mutation rates in bacteria are enhanced when they encounter an environment that is so hostile that they completely stop growing and reproducing. In such conditions, a spate of new mutations is generated throughout the genome. Every little single mutation is random, in the sense that it is not function-specific, but the general genomic response - the increased mutation rate - may be adaptive.
Not everyone accepts that stress-induced mutation is an evolved adaptation, however. Some people argue that the spate of mutations that occur in adverse conditions is simply a by-product of stress-induced failure. When cells are stressed, especially when starved, one of the things that may happen is that they are no longer able to produce the proteins needed for DNA maintenance and repair. It may even be that starved cells are obliged to turn off their DNA-caretaker genes to save energy. If so, faults will occur and remain uncorrected. In other words, there will be a lot of mutations. In this case, the generation of mutations is just a pathological symptom of the problems cells are experiencing, not an evolved adaptive response to adverse conditions.
From: Eva Jablonka & Marion Lamb - Evolution in four dimensions