This is closer to my area, you're basically right. Viruses copy a lot in immunocompromised people for a long time. Lots of copying is all ya need to make variants.
This happens because living sick people help spread the disease, while dead people don't.
Viruses dont "care" to kill people, viruses only "want" to spread. That's what drives a viruses growth