
Amy S. answered 07/24/19
Certified Math and Science teacher with MS
This is a great question! Thank you, and I have had students ask this question before, so hopefully this explanation helps adjust your thinking toward a more scientifically accurate view of how viruses have evolved.
Viruses don't "know" specifically how to hijack a cell and take it over even though that is their primary goal. Viruses have evolved over time through mechanisms such as natural selection, genetic drift, mutation and gene flow. Through the process of natural selection if the virus is unable to enter the endosome of the cell or if it is destroyed by the cell then it no longer replicates. However, if only one virus enters and that is due to a genetic advantage that the virus has, it is able to replicate and then eventually lyse the cell releasing hundreds of phage progeny into the surrounding environment. The infection spreads rapidly and those viral particles that have acquired the selective advantage in the population are able to reproduce progeny that also possess the selective advantage. This is how organisms evolve over time.
Best of luck to you!