The advance is, theoretically, payment for services rendered; after all, you've already written the book*, so you're essentially being paid for the legwork you've done so far. Oftentimes the advance will be paid in installments, with the last installment being paid out when the final manuscript is received and deemed ready for publication (or, occasionally, on or shortly after the date of publication).
In my estimation, you're unlikely to get much more than $10,000 for a first novel (though some genres and writers average slightly higher, perhaps $20,000 or even $30,000) and the royalty rate will probably work out to somewhere between $1.00 and $3.00 per book. If we assume a $10,000 advance on a $20.00 book for which, when all's said and done, the house earns a $2.00-per-copy profit, that house will need to move 5,000 units to break even, which is about right for your average début. Many books, however (up to 75% by some estimations) do not move sufficiently well through the register, and therefore do not earn out the advance paid to the author. Good (in the short term) for the author, bad for the house; in the long term, a string of unearned advances can have a negative impact on an author's career and is also pretty bad for the house.
There are many arguments for and against the no-advance model, but I think it's best summed up as follows: publishers will be much more willing to take risks on new authors if they don't need to pay an advance, but since this removes the "we paid for this and we have to make it work" pressure, many a publisher may reduce the amount of time, money, and effort spent on marketing these books. While a no-advance model would likely result in a higher royalty rate for the author, it won't do much good if net sales are damaged by a reduction in in-house support.
This may be an overly pessimistic view of things, so I'm curious to know what you think. What say ye, readeurs and readeuses?
*This isn't necessarily the case for non-fiction, in which case the advance also theoretically covers research costs.