Environments are constantly changing; the trick is to live long enough to pass one's seed to the next generation. That is where evolution comes in. Random mutation gives a population the tools it needs to survive. Some of the tools might be detrimental, so they are quickly removed from the population. Some of the tools are beneficial, so they survive and are passed on to the next generation of the population. The next generation builds upon these beneficial mutations and adds its own tool box of random mutations. And so on, and so forth ...