In order to explain how a media agency values media on behalf of their client -- the advertiser -- we should first discuss the way that advertisers set their overall marketing goals. This process actually frequently begins way back before the product being marketed is even built.
When a company is going to build a new product or service, it typically spends quite some effort on determining who the target customer of that product or service will be. The company does market research, defines "personas," and does extensive market sizing efforts. Personas are a key concept to understand, as they are the core mechanism that applies to product design, development, go-to-market strategies, the overall marketing plan, the advertising creative development, and ultimately the media plan and request for proposals sent to publishers.

Personas are descriptions of ideal target customers for whom the product was designed. They are very rich descriptions -- typically defined by more than a dozen (sometimes even dozens of) data points. Typically, a set of personas is designed by a marketer, with at least three, sometimes as many as ten, variations on the core.
To illustrate this, let me give a theoretical example: The product we'll ruminate on is a new high-end line of ladies fashion scarves. The company creating the scarf is a successful clothing designer that has distribution in place with large department stores, fashion boutiques, and a large direct online presence.
When designing the new line of fashion scarves, the marketing team has developed a set of personas that they believe will typify the target customer:
Veronica
Veronica is a wealthy stay-at-home mom, who lives within 50 miles of a major metropolitan area, in a part of the country where scarves are needed for some part of the year. She lives in a home valued at $1M+ with over 5,000 square feet and has some kind of domestic help who spend at least one day a week in her home (a Nanny, cleaner, or similar). She drives a luxury SUV, has children in private school (of course, who play soccer), and shops for groceries at a high-end independent grocery store. She shops for clothing at high-end boutiques, spends at least $1,000 monthly on clothing and accessories, and attends a high-end gym with a trainer. She runs a book club or similar kind of social club, volunteers on the board of a charity organization that meets monthly, attended private school and college herself, hosts parties at least three times a year, and attends parties and events where she would be expected to "dress up." Her husband drives a luxury vehicle and regularly buys her gifts. Veronica is a fashionista; she's known to always be dressed in designer clothing and is always "on trend." She reads numerous fashion, entertainment, and lifestyle magazines, visits numerous fashion websites, and watches various fashion related TV shows. Her style could be described as "tailored."