If XProtect detects malware it will block the software and remove it. XProtect will check for malware when an app is first launched and if it has been changed. Apple monitors for new malware infections and updates XProtect regularly. XProtect detects and blocks any known malware. On the software side, macOS includes its own antivirus software built in.