The term firewall was originally used to describe physical walls in buildings that were made of concrete or steel. Firewalls functioned to halt the fire from spreading past that room or apartment. It was also designed as a safety feature. It happens to make a great metaphor which is why the current definition still remains valid today. In technical terms, a firewall is network security that looks at incoming and outgoing network traffic and prevents unauthorized access to maintain information security.
Within a computer system, there are internal networks and external networks such as the internet. The internal system is always trusted because only the user has access to this network. However, the internet can be malicious. Several types of malware and cyber hacking codes can infect networks and dramatically damage them instantaneously. As a result, firewall network security features diverse types of methods to combat damaging malware. The method for intrusion prevention depends on the type of firewall in effect and the predicted dangers.
For more info: firewall computer security