A firewall protects an organization's internal network from external networks like the internet. There are hardware and software firewalls, with hardware firewalls protecting an entire network at the router level and being more expensive. Firewalls work by inspecting packets of data and determining whether to allow or block them based on rules. They focus on security and can enforce policies to protect information while limiting exposure to threats. However, firewalls have limitations like not being able to protect against internal attacks.