All that adware does, when it is injected onto a website is edit the HTML files to add images and links onto the pages. It's actually quite easy to do if you know anything about HTML and Web design. Knowing Javascript is also highly beneficial because you can create persistent ads that won't go away until the user clicks on them, or doesn't have an option to close the window at all. You don't even really have to know anything about hacking unless you're putting adware onto a website owned by someone else. In which case, you'd have to get access to the webhost's administrator control panel.
In most cases, hackers will inject their own links into already existing ads on websites in order to redirect website visitors to malicious links where they download Trojan horses and viruses of all kinds.
If you're talking about adware being installed onto someone's computer, this is a bit more malicious, but mostly just annoying. All youre doing is creating a program that opens windows persistently to trick the victim into buying a product or to just make the ads go away.
Malware Dev & Grey Hat available for contract work. DM if you need me.
OSCP, OSCE, OSEE, OSWE, OSWP, CEH, CISSP
Yeah, I've been around a while