a) the technology used b) how much exposure you have to technology that can capture your interests (or your socio-demographic profile etc.)
If you use Gmail you will find that their ads are usually quite a good match for your interests, because the amount of exposure with Google is huge for the average user, and because they can use semantic contextualization on your mails...