Intro to firewall's :-
While your using the internet you have a single IP address and you talk to other applications (like a webserver or the MSN messenger server) on different "ports".
Think of it like CB (now I've done it!) radio. You have the same "handle" (IP address) for people to address you as but when you talk to someone you take it to another channel (port number).
For example, the standard port for web traffic is port 80 so your web browser (like IE6) talks to a webserver (like the one this site is hosted on) on port 80.
A firewall monitors all this traffic and allows you to set rules as to what is allowed out and what is allowed in. By doing this you can control the flow of information that goes from and to you machine.
So the standard firewall rule is to allow nothing from outside to get in but allow any request from machine to get out (and allow any response back from that request).
The problem comes if your pop up's are caused by an application that has somehow installed itself on your machine. Then it's you that's making the request for the pop up and you have to get for strict with your firewall rules (like disallow all outgoing requests except for port 80).
I use firewalls a lot on Linux boxes but only on one Win2000 box. Can't remember what it was called but it use to promt you every time something tried to get in or out and based on your allow/disallow responses would build the firewall rules accordingly i.e. you don't need to know any of the above.
For the paranoid among us if your getting pop up's that look like little web pages then you can pretty sure that you're web activity is being monitored by the same software. If you have win2000 or NT or anything with a Task Manager then look in the process list for any of the following
http://www.winpatrol.com/stats.html
Cheers
Jason