Since many websites uses "widgets" from Facebook, Twitter, or tracking code from Google (Analytics, AdSense, etc), through cookies Google / Facebook / Twitter and whoever that deploy these type of thirdparty "thingy" across many websites will be able to see your browsing history as you visit any website that deploy their code.
For example, if you visit www.badsite.com, and badsite has a Facebook social plugin put on their page, then Facebook will know that you visited www.badsite.com. Facebook will know all the sites that you visited that has some kind of Facebooks "plugin" code deployed. With all those "like" or "share" buttons, most sites will have such a thing.
To prevent this from happening, you have some choices:
1) If you use Firefox, you can block cookies from specific domains. The downside is that now you can no longer login to them. For example, I block all cookies from google, facebook, twitter, addthis, sharethis etc from my Firefox browser. The problem is of course, I can't login to any of these sites. But they won't know my browsing history.
2) If you use IE8, you can turn on "InPrivate Browsing". This is a very neat feature, it blocks automatically code to send cookies to thirdparty tracking sites like Google, Facebook, Twitter, etc. InPrivate browsing is smart enough to count any website that receiving thirdparty tracking info. If a site did this 10 times (default), then the site will be blacklisted and IE8 won't send anymore cookies to that site.
This is better than firefox because you won't lose the ability to login to Google / Facebook / Twitter etc. And they automatically add new ones to blacklist.
The downside of this plugin is that you have to turn it on everytime you start your browser. However, there are registry changes you can make (Search for InPriviate automatic) that will turn it on by default.