To be fair though, a lot of publishers also do a one time payment deal with authors as well, after achieving a certain milestone of number of books sold.
For 99%+ of authors, writing is a hobby that pays less than minimum wage. For self published authors it's often a net loss after costs like editors and cover design.