Essentially, there's a publisher side (the website displaying the ads), a supply side (the advertisers wanting to display ads), and the client (you). The advertisers might be individual corporations, but they could also be agencies that represent various advertisers or corporations as well.
Traditional advertising was either the publisher or supply side contacting each other to set up a campaign. They could strike a deal like "display my ads on your site for a week for $x" and off you'd go. A contract was signed, you added a banner, and things were fine. You could compare that format to what would be magazines and TV ads: the website was part of a target demographic and you could just buy time as-is. Eventually it evolved when sites got more general (say, news websites or dating websites) where a wide swath of the population could be on the same site. The idea became to target even tighter. The dating websites I used to work on had things like: age, gender, sexual orientation, interests, and so on. We could