the author in theory gets royalties for every book sold (though usually not that high), but almost all books do get an advance, and as you point out, the royalties are so small that almost no books ever 'earn out' of the advance. so almost no authors actually get royalties for every book sold. they do get the copyright, though