Mutations are random, nothing really is preventing a virus from replicating rapidly and killing a lot of its hosts in the short term, it's just the long-term evolutionary advantage of such traits are small, because killing hosts quickly reduces replication, potentially.
But that doesn't stop viruses and bacteria from mutating into something deadly and killing a lot, or all, of its hosts. However just that has happened throughout evolutionary history on Earth, and even in humans' history. We've seen plenty of pandemics wage war against humans and cause considerable casualties.
There's also plenty of equilibria deadly viruses can reach with their hosts, where they kill a relatively large amount of hosts, but not enough to wipe them out.
On the other hand, faster replication is also often selected for, which often corresponds to more virulence.
Both trends have been observed, depending on a whole lot of complex factors.
https://en.wikipedia.org/wiki/List_of_virus_species