How does an anti-virus work?
An anti-virus searches for suspicious patterns of code in applications and files. It is equipped with a list of suspicious patterns that have been observed to be a part of malware. If one such pattern is found, the anti-virus will alert the user and allow them to either quarantine the suspicious file/application or delete it.
The reason that it is highly recommended to regularly update your anti-virus is that the updates contain more and more patterns that were found in recently detected malware. That means that updates increase your chances of being protected against the most recent malware outbreaks.
When the anti-virus performs a scan on your device, it searches for these patterns in the files on your device. An anti-virus works relatively fast because such questionable patterns are usually located at specific parts of a file/application, so the job of an anti-virus is reduced to searching only at these parts.