Antivirus and malware detection programs scan files looking for specific patterns or signatures in the programming code that match known malware. This signature-based detection helps identify threats that have already been documented by security researchers.