Usually we use PeerGuardian to block unwanted connections from know bad ip's while we are P2P-ing. Those bad ip's could be from fake p2p file sources , anti-p2p companies, goverment servers , spyware servers , ad trackers etc. All of these IP's are contained and updated in blocklists(like the ones from blueattack) and PG constantly reads those lists and if an IP from that list tries to establish a connection to your PC then PG simply blocks it.
But PG can block all traffic not just for P2P programs. It can also work with http so if you try to connect to a certain IP via http protocol and it is contained in the blocklist it will block it. You can also make your own lists and exclusions.
Now i will try to find a more TECHnical explanation for you ... Here is the wiki link for PG manual
LINKGo here for more info on what those Blocklists from B.I.S.S. contain. I recommend using these instead of the default ones PeerGuardian uses(blocklist.org) because they are more often updated.
LINKYou can use Blocklist Manager to get those lists and then export them into Peerguardian.
With Blocklist Manager you can even export those lists into some firewalls like ZA Pro.
The program also has some nice extra features like whois and traceroute.
Read the links i gave you and then try both of these programs and let us know what you think ...
EDIT: Here are the download links for Peerguardian and Blocklist Manager
Peerguardian
LINKBlocklist Manager
LINK