Sites like it because it allows them to command higher CPMs for targeted advertising. And advertisers like it because it allows them to get their offers to the right people and boost the effectiveness of their advertising. First, a site needs to devise a way to collect information from its users. Many elect to ask users to fill out a quick questionnaire form. After collecting the necessary information, the site needs a simple way to associate this information with the user who submitted it.
Some sites write a cookie to the user's hard drive that corresponds to a profile in a database.
Others will associate the information with a given user ID and password. There are pros and cons of each Associating via a cookie makes it tough to distinguish between multiple users on a given machine. However, most people don't like to give a name and password every time they go to a site, so often a cookie is the best option for associating a profile with a user. Sites collecting information must find a way to integrate their profile database with their ad management system, so that the ad server can use the information appropriately to deliver the targeted advertising. Believe it or not, some sites collect a zip code during registration, but may use IP targeting to serve ads geographically.