There are two main ways. First, the video publisher can choose to have ads on them. If the content is copyrighted, the rightful owner has a choice of monetizing the video and allowing it to stay up as well. (The other choices are to have it removed or silenced.)
Bear in mind, the ads provide the video publishers with income, so they can afford to keep making videos, and they also generally get a choice of what type of ads display. For example, the Mug videos should have little ads that appear at the bottom, which you can click to close. Other options involve video ads... what shows up is at the discretion of the publisher, and their choices affect what they earn. Generally speaking, the more obnoxious/ intrusive an ad is, the more the publisher stands to make from it.
YouTube only allows monetization through AdSense for publishers, but they also offer a paid service for viewers that removes the ads.
Ignore them. That always works. Or you can download adblock plus. It works quite well. (Sorry JA)
This post was edited by Element 99 at December 21, 2016 3:08 PM MST
Remember that many so-called "social media" sites, along with schemes like supermarkets' so-called "loyalty cards" exist to mine and sell personal details to advertising-agencies. This is Facebook's primary business.
The web-sites need income from selling advertising-space to operate, just as the newspapers do, but some go further. AM seems to refrain from the practice, thankfully, but others will link your details and forum-tracking to what the advertisers offer their owners, so you receive advertisements of supposedly more direct interest to you. I think they call it "personalised" - ugly jargon showing only the basic illiteracy of the advertisement trade.
Experience Project did this. One of its sponsors was a dating-agency whose "hook" was a photograph of an attractive woman captioned with something like "Sarah lives only four miles from you". Needless to say, that was a lie - well, funnily enough, a Sarah did live about 4 miles away, but she's my sister. The panel opened the home-page of an agency that had had to use the American-based EP's records to be able to offer me eligible ladies living at least in Southern England, if not my county. (Equally needless to say, though single, I didn't respond: dating-agencies are among the biggest legal scams going!)