Anti-virus works on the basis of specific algorithms.For example "propagation model algorithm". This algorithm is used to track virus according to the propagation across the system as the name suggests.
The best anti-virus available free is Avast according to me.Because it will use less memory and thus its very fast.
The best paid anti-virus I think is Kaspersky. Because its updates regularly.