Note: This is my understanding, not an expert answer based upon source code.
File system scanning would occur after the file is written to disk but before it is accessible. Otherwise the file would have to be loaded into memory or partially scanned as it is being written. While I've never looked I suspect the virtual file filter driver used by AV is probably one of the last filters to run so it can catch malware that might have installed themselves in the kernel somehow.
But in addition to file scanning AV tools like defender also have memory components that are running so there is protection for in-memory malware that might never use the file system.