A simplified definition for a network firewall is that it is a tool that implements the traffic checking that has to be done (for security purposes) among two or more networks.
The network firewall has multiple missions; primarily, the firewall is in charge of monitoring, inspecting, and controlling inbound/outbound network traffic. The network firewall utilizes the user-defined preferences in order to determine whether to permit or deny communication with a specific network. Those user-defined preferences usually define the characteristics and the criteria by which the firewall determines whether to allow or discard the network traffic. Specifically, packets will be checked to examine their purposes. If the content represents hostile intrusion attempts, unauthorized attempts or patterns that match those of denial of service attacks, then the firewall will automatically block them.
Additionally, the firewall will check the IP address of the sender of the packets. Usually, the firewall can discard the packets without even examining them. If the IP address is unknown and if the firewall is configured accordingly, it will automatically block those packets.
Network firewalls are mostly used in order to isolate all computers that belong to a specific network from the rest of the networks. To be concrete, the network firewall might be needed in order to separate different sub-networks within a big network of a corporation. Furthermore, the network firewall can be used to separate a private network from the Internet.
As you can see, network firewalls are very important if you plan to separate your network from any others that you wish limited/controlled communication with. You can think of the firewall as if it were a family dog that only recognizes family and relatives or friends.