On computers it keeps the hackers on one side and you on the other. After all you don't want anyone looking into your accounting software, internet history, password lists, log files and most importantly they not place a virus or link from your machine to their machine. You control your computers firewall and can place holes or open access connections to the other side when you want. There are two very well known and trusted software firewalls. Anti-Virus software is like a newborn baby with no shots or protection from the surrounding elements.
Infection is eminent and sometimes deadly.
Even if you are cautious and follow safety guidelines, such as not opening email attachments from people you do not know or downloading files from uncommon websites, without proper virus protection just like the newborn you will catch a virus. Some viruses do little or no damage and some do VERY VERY BAD things. Anti-Virus programs scan data that enters your computer for known virus code and prompts you when the known virus code matches a virus coming into your machine. Also when you run a program or open an attachment it will warn you if it detects a virus. Because it only scans for known viruses you may still be infected by a newly created virus.