Firewall and antivirus software are two fundamentally different kinds of security applications, both designed to protect an individual's computer system from invasion and assault. A firewall is set up to block access from unwanted network communications, often including both incoming and outgoing messages. Antivirus software is designed to deal with maliciously designed programs that find their way onto a person's computer. Firewall and antivirus software are often distributed together as part of a single software package, and because of the nature of some network threats, they often work in tandem to protect a person's system in different ways from the same menaces.
Viruses are constantly changing as malicious programmers come up with new ways to corrupt computer systems, and antivirus software has to change along with the threats. Most antivirus apps are designed to monitor running programs for new threats, and usually the user can run a scan for infected files, removing any that are found. Sometimes a new virus will be developed that the program doesn't recognize, but most antivirus applications are set up for daily or weekly updates to the core program that help expand capabilities and allow for the recognition of new threats.
Firewall software is designed to protect against unwanted network communication on a computer. Malicious individuals sometimes try to access other people's systems through a network connection in order to gain access to an individual's private information or install malicious software. Firewall programs can recognize unauthorized communications and block them. Sometimes the software is set up with specific rules about what sort of communication is allowed, and in other cases, the rules may be user-defined with different levels of security for different situations.
In many cases, firewall and antivirus software packages can often be very complimentary in the way that they function. For example, many viruses are designed so that they try to send messages out to the Internet; distributing private information about a person's browsing habits along with credit card numbers and other data to malicious individuals. A good firewall will recognize these sorts of attempts and block them, which can be helpful in cases where the virus is too new to be recognized by the antivirus program. Another situation where firewall and antivirus software can work in tandem is when malicious individuals attempt to access a system through the network for the purposes of implanting a virus. In these cases, if someone finds a way through the firewall, the antivirus software can serve as backup protection.