Janet Reid just posted a very concise, very helpful summary of how advances and royalties work. Well worth a read for anyone considering signing a trade publishing contract.
Not much to add to it other than, yep, that’s how it works. (Although it was good to have that reminder about multi-book deals paying the on-signing portion for all books at the start of the contract. And what happens if you don’t deliver that final book or two.)