An inert molecule that kills all its prey will not survive.
The natural selection will favor those molecules that are able to spread without extinguishing all their guests.
It is something like: if something has high odds to exist, given enough time to possibly exist, it will exist.
So an inert protein coming into existence? Sure. Better odds to be replicated? Then it'll happen. We ascribe agency or will to survive. Those probably help the odds in a lot of cases. But the concept is broader than that.
(technically, the self-replication need also admit mutations into the replication process for natural selection to apply. viruses do mutate so, they qualify)