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.
Get more info: firewall and network security