It has something to do with the ad that was shown on that page when googlebot indexed it. And it's not the ad code itself, the ad code could stay the same for years. It's the ad.
If you run a website, you can allocate specific placements on your pages, but instead of always showing the same ad there, you can go to an ad network and have them serve the ads that are the best 'fit' for your content. The ad network is like the broker, because they also deal with the advertisers. Often the advertisers will provide the creatives that can be used on the publishers' sites. The more advertisers the ad network has, the better selection of possible ads that can be shown on your site.
What has happened is an unscrupulous advertiser did a bait-and-switch... they likely provided the network with an innocent ad, but once the network agreed to provide it for the publishers, they pointed the link to something else, so from the ad network's perspective , the 'ad' came from the same location.