It's more just the result of constant mutations that produces these variants of concern, than any strategy that the virus might have. SARS-CoV2 is an RNA virus, so it tends to mutate with very high frequency. If enough of those mutations result in a change that allows the virus to infect cells easier, or get around antibodies, or spread from host to host in higher numbers, then that will be come the dominant variant strain. So, it's mostly luck.
With the possibility that omicron arose from an immunocompromised patient who was unable to fully clear the virus from their body and thus allow the virus to continuously undergo mutation until the sequence for omicron became established which could then spread through populations with low vaccination rates, it is more important than ever to get more people around the world vaccinated.