Avast is a resident (on-access) antivirus.
Not all files are scanned when opened only those which are susceptible/targeted by malware, these are files like .exe files but many other file types are included, those that have been/can be infected . Whilst this isn't unique to avast, it is at least showing when it is scanning by rotation of the avast tray icon.
The fact that avast scans multiple areas, files on your system, web sites that you visit and emails that you receive or send. So it is quite extensive. Depending on what modules you have installed and what avast version that you have, it can be scanning quite a lot.