If we assume that the average retail price of a print book is $10, then the average wholesale price is $5 (the $5 difference represents the retailers’ costs for store rent and personnel, including a profit of, at most, only 50 cents for the retailer); the costs of paper, printing and binding are roughly $1, the author’s royalties (15 percent of retail price) $1.50, internal publishers’ costs (including marketing, sales, warehousing, inventory management and distribution) of approximately $2, on average, leaving a publisher’s margin of 50 cents.
So, on a $10.00 book (retail price), the bookseller (e.g. B&N) makes $0.50, the publisher makes $0.50, and you and your agent make $1.50 (my understanding being that you retain $1.27 and your agent keeps $0.23). More detailed information on advances and royalties can be found in Moonrat's post on the subject.
Now it's worth noting that most author/publisher contracts don't specify a single royalty rate, but rather a full schedule of them, which varies depending on different circumstances of sale. This is almost always the case if the publisher is calculating your royalties based on wholesale price (i.e. the discounted price at which they sell the books to the book stores, generally around 50% of the retail price) rather than the full retail price. A full explanation can be found in Stephen Nelson's article on how author royalties are calculated.
If I recall correctly, the original question had to do with whether and how bookseller discounting could affect author royalty rate. The short answer is, if your contract indicates your royalties will largely be based on the retail price of your book, then discounting by the bookseller can impact your royalty statements; if, on the other hand, your contract indicates your royalties will be calculated based on the wholesale price of your book, then your royalties will vary depending on how many copies of your book are sold through to book stores by the publisher. Stephen's article (above) does an excellent job of explaining this, but the idea is that if a given account buys more copies of your book, they can expect a steeper discount; a steeper discount alters the wholesale price, thus altering any number that is a fixed percentage of that price (like your royalties).
So, if your percentage is taken off the retail price, Borders, B&N, &c largely determine the size of the check you receive (after your agent's commission and taxes). If your percentage is taken off the wholesale price, your publisher's sales department and those notorious account buyers determine the size of the check (based on how many copies are sold from publisher to account, including initials and reorders).
If you're curious to see how agents view the royalty system, Ethan Ellenberg (of the Ethan Ellenberg agency) has written his own article on the subject, which I highly encourage you to read.