Can anyone explain how exactly a anti virus works..

and if possible point me in a direction to find out more.

Thnak you