The Firewall act as an intermediare between your computer and the network you connect to, in most cases the Internet. The firewall is a bouncer, it control who can walk through the door and who can’t. In computer terminology the door is called a port. Each networking service has its own port, ordinary web surfing most often using port 80.
A firewall is important for you to protect yourself against crackers, script-kiddies, worms, and everything else that tries to connect to your computer, e.g. to read your files.