What does a Firewall do?

A firewall is very important to a computer system. Its job is to protect the computer from unauthorized access. Although, it allows the user of that computer to communicate freely past that wall.