Affiliate programs are a form of advertising that work by giving you an ID that you add to the URL of a link on your server to a particular seller's site (Amazon, etc.). This ID allows the seller to determine which affiliate drove that click to their site, and the affiliate (the ISP in this case) is paid a fee for sending that click to them. What's happening here is that the ISP is taking the initial DNS request and doing a redirect to a URL that includes their affiliate ID for vendor sites they participate in affiliate programs, but they're doing it for *all* DNS requests for those sites, not merely in response to clicking the advertising links provided by the seller.
For instance, Amazon offers page banners for their affiliates to post on their own sites that contain links to products you might be interested in, and if you click one of those links, whoever is hosting the banner will get paid for that click based on the affiliate ID contained in the links in the banner. In this case, if you just enter "www.amazon.com" in your browser, the ISP is adding an affiliate ID to the redirected URL your browser is given, so the ISP is being paid by Amazon, who thinks that someone clicked on one of their ads even though the ISP didn't display a banner or otherwise perform the service that Amazon is paying for. The ISP is exploiting the trust that the seller is extending to their affiliates in order to get paid more than they're entitled to, and they're basically stealing money from the seller for advertising that was never provided.