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...
The manufacturer of my car has never displayed an ad trying to get me to take it in for a service, or sing the merits of the newest model that hits home for an existing owner. The various credit related ads seem to think I don't know money is fungible, or that I can't count. The various health and beauty products are extremely misguided. The food related ads are beyond stupid. The cell related ones assume that ETFs don't exist. I can go on, and on ....