You add lines to your hosts file, so when a web page tries to push an annoying banner ad from a known ad-spammer to your browser, your browser looks at the localhost (127.0.0.1) for the ad instead of to the ad-spammer's host. This prevents the ad from loading, since obviously the ad isn't to be found at 127.0.0.1.
In my earlier post, I listed the names of (some) Google ad servers.
Here's a link that explains it better:
http://accs-net.com/hosts/what_is_hosts.html
This works brilliantly. Think of it as a pop-up blocker for banner ads.