Advertising is a cookie.
Cookies are small text files stored in the browser on the user's computer, when visiting web pages.
Cookies store information that can be used for several purposes: to personalize web browsing, to gather demographic information about how many users visit a page, to monitor which banners are displayed to the user, etc.
These uses are not, in theory at least, malicious.
Advertising does not spread automatically using its own means. It needs an attacking user's intervention in order to reach the affected computer. The means of transmission used include, among others, floppy disks, CD-ROMs, email messages with attached files, Internet downloads, FTP, IRC channels, peer-to-peer (P2P) file sharing networks, etc.