Viruses and bacteria are treated differently, understanding the biology of viruses and bacteria allows us to develop treatments accordingly to such infections. For instance, some antibiotics (such as penicillin) works by disrupting the cell wall of the bacteria & hence killing them, while using penicillin in a viral infection would be ineffective as viruses' biological structure and functions completely differ. I haven't done much studies on antivirals, but a mechanism plants use is the production of protein-synthesis inhibitors which prevents the infected cell from transcribing viral DNA & hence prevents the spread of the virus within the plant, as they require the ribosomes of living organisms to replicate.