I didn't think to include this in the last post, which is OK because it's needlessly complicated, but another way writers make money - sometimes, how they make most of their money - is in foreign rights.
Remember that when a publisher buys your book, they don't buy the physical book. They buy the right to copy the material in the book and then resell it. Different companies will ask for different rights, and it's a good agent's job to negotiate what rights you give away in the initial offering and what rights you hold on to.
For example, a publisher will ask for world rights. These are, obviously, the rights to publish anywhere in the world in any language. The publisher has total control over your book. Agents don't like to give this away, or not unless the publisher actually has the ability to publish the book all over the world and is willing to pay a lot of money.
The stage below that is generally considered to be English-language rights. This means everything but translations, so you can still sell to foreign companies that intend to produce your book in another language. It's still a major rights grab, though.
What an American agent would probably prefer you to sell is North America & UK rights. In other words, the English-speaking and easily-shippable world (Australia and India, two big English markets, are far away). So they get the US, Mexico, Canada, and the UK, and possibly Ireland depending on some fine-tuning of the language.
Why would you want to keep as many rights as you can? Because if you have a good agent,t hat agent will have contacts with foreign agents around the globe. If the book even moderately successful, the agent will then take the books to the other agents and say, "Shop this in your country." Hopefully, the foreign agent will succeed in selling it to a local press, and there will be another contract for you with another advance (meaning $$$). Then rinse, repeat.
It is common practice in the publishing industry for agents to take a higher commission on foreign rights sold, say 25% instead of 15%, because they did more work and the foreign agent also has to get their cut. My boss, who does a lot of work in foreign rights, has probably 30 agencies she works with. I'm just guessing about that based on the amount of addresses I've had to write out on customs forms, some of which had characters I've otherwise never had to write (Thai is really hard). Some she hasn't spoken to in years, some she's in constant contact with, but they're all there, and if my boss is lucky she will sell the book an additional 5 times after the initial sale to a US publisher. And that means more money for her - and a lot more money for you.