Of course its random. I think you're under the impression that mutations only happen when they're needed and then only mutations that are helpful happen. This is not the case at all. The majority of mutations are neutral (they neither increase fitness nor decrease it). Many mutations are harmful, they cause fitness to reduce. Some mutations will be helpful, they make the individual more likely to reproduce. Natural selection ensures that the helpful ones are forced to stay, and the harmful ones are forced out. The neutral ones are neither forced to stay nor forced out.
Edit to add....what i'm trying to say is that mutations happen with every individual. I can't remember the exact number, but I think on average each human has about 50 mutations that their parents never had. They don't just occur to solve a particular problem a species is going through. And they don't occur for every problem. If a helpful mutation doesn't come along, the species may just go extinct.
This message has been edited by happy_atheist, 09-08-2004 07:41 AM