Viruses change all the time. That's because they copy themselves to reproduce. Think of our cells as having their own xerox machines, which the virus takes over for its own purposes. When a virus makes a copy, sometimes a random change can occur in the copy's DNA -- the double spiral-shaped molecule which acts as a manual telling our bodies how to develop and function. If enough of these changes happen over time, a new variation or strain of a virus can emerge.
Mutations happen in two main ways. In the first, small copying errors in the virus lead to changes in the virus' surface proteins, which sit on the outside of the virus. These proteins look to attach to your cells (much like boats seeking to tie to a dock). These changes result in more closely related virus variations, like the new Covid-19 variants.
In the other way, two variations infect the same cell in a person's body and combine to form a new or "novel" virus. This often happens when a variation that only infects animals comes into contact with a human variation. This version of mutation could have created the novel coronavirus which causes Covid-19.
Our immune systems respond differently to different virus variations, and so do vaccines.