According to SurfTheNetSafely.com "Internet cookies are small pieces of information in text format that are downloaded to your computer when you visit many Web sites. The cookie may come from the Web site itself or from the providers of the embedded advertising banners or other graphics that make up a Web page. Thus visiting a single Web site can actually result in the downloading of multiple cookies, each from a different source. You may never actually visit a page of one of the major advertising agencies like Doubleclick.com but you will still get cookies from them."
While cookies cannot contain viruses or malware, they can be used to track your browsing habits. Let's say for example that you have been looking at multiple web sites to find kitchen appliances. Suddenly you see more ads for kitchen appliances popping up as you browse. This is probably the result of a tracking cookie.