There is a very old joke about writers.
“What’s the difference between a large pizza and a writer?”
“With a pizza, you can feed a family of four.”
I don’t know when I first heard that gag, but it comes to mind at least twice a year. That’s when, in April and October, I am paid the royalties for my books. That is to say, in the middle of those months, I learn what half my income for the year is. It’s based on the sales of my books over the previous six months.

Mind, there are complex equations as to how that amount is figured; there are different percentages of royalties paid for hardbacks, paperbacks, e‑books, audio books, foreign sales, and a host of other variations and classifications. Each category pays a different royalty percentage.
The crucial point is, I am never sure what the total amount will be. My income is always changing.
[If an author wishes to dispute the amount, he/she can audit the publisher’s accounting, but the writer must pay for that audit. I once learned of someone who made a business of auditing publishers’ accounts, so there must be a fair number of writers who do so. I never have.]
There have been times I have been surprised by the royalty paid me. Sometimes that is because the royalties are more than I had anticipated. Sometimes it has been less.
The total payment pertains to all of the books I have published that remain in print, from the oldest to the newest. Thus, in my most recent royalty payment, my very first book, Things That Sometimes Happen, which was first published in 1970, just earned me a royalty of $5.16. After fifty-five years, it amazes me that it is still around.
There is a key factor in all this that must be further understood. When a book of mine is accepted for publication, I am paid an advance, that is, a negotiated (by my publisher and my agent) fee based on the royalty that the book is projected to earn. This money is actually a loan to me. It is meant to allow me to live while I write the book. That has sometimes been the true case. However, the further point is that I do not get paid a royalty until I pay back that advance, and I do that with the sales of the book. If the sale of a book goes well, that advance is paid back quickly, and I start to earn royalties. Best-sellers are good. Awards help. So do review stars.
If sales are slow, it may take much longer to earn royalties. There have been very few books of mine that have never paid back the advance. Still, to this moment, I have never earned royalties for those books.
Furthermore, with newly published books, it takes time to earn back that advance. I don’t recall ever paying back that advance in the first six months of publication. So, at best, it will be at least a year after the publication of a particular book that I will begin to earn royalties.
To be fair, if the book does not ever pay back that advance, it is understood that I do not have to pay back that advance [loan] out of pocket.
Let me be very clear that for many years, I have made a decent living as a writer. Yes, there have been fat years and there have been lean years. But I have never been forced to apply for a job as a pizza maker.