Virus mutations can lead to better virus variants, but they also have the potential to cause severe pandemics. There are two main types of mutation: Genetic mutation and phenotypic mutation.
Genetic mutation occurs when a gene within a virus is altered or destroyed, especially when it comes to the requirement for other genes in order for the virus to be infectious. If certain viruses need this gene in order to work, but there isn't enough genetic material left over after the removal of that gene, then there are no more sufficient supplies of this necessary gene left and those viruses become non-viral mutants. This is how HIV was mutated into HIV-2.