Mutation is engrained in the very nature of life. Even if there were no X-rays, free radicals or toxic chemicals, mutation still would take place because of errors in the replication of DNA that occasionally escapes the proofreading mechanisms of meiosis and mitosis.
The majority of germline mutations produce LOSS OF FUNCTION, and are weeded out by evolution. In vertebrates, mutation is vital in producing the random changes in the DNA of germ cells of the ovaries and testes. If the mutation is beneficial, involving a GAIN OF FUNCTION, environmental selection acts to preserve the change, producing the diversity of organisms in the world, each exploiting a different environmental niche.
It is the rare species so versatile, like the shark, that can remain almost the same over eons without dying out. In the teeming unicellular world, mutation in the genome is similarly useful in allowing for variations which often prove useful for survival. The mutations thrive if the proper environment presents itself. For instance, antibiotic resistance may be encoded in a few members of a bacterial species, which become the dominant members in an infected patient on antibiotic treatment, and crowd out family members without the mutation.
In Viruses, RNA is often the Memory nucleotide. RNA is less stable than DNA. The resulting instability allows more mutations, and sometimes greater success. An example is the English Covid variant in the spike protein which leads to greater contagion. Hopefully, the spike protein change will not be so successful as to interfere with the effectiveness of vaccine-produced protective antibodies.
The Mutations we have been discussing refer to GERMLINE mutations, which occur in the gonads. In higher animals, germline mutations affect the offspring, which then carry the mutation. A GAIN OF FUNCTION mutation may confer greater adaptability and survivability, and perhaps may lead even to a different species, if the troop number is small and the environment demanding. Non-germ SOMATIC cell mutation may lead to undesirable effects like cancer, which is another discussion.