Don't you have to send in an completely polished ms with no mistakes?
No.
Okay, a few quick responses...
Nonfiction is typically sold based on a book proposal, not an entire manuscript.
In the case of stories that end up on the news and such, sometimes even a proposal isn't necessary-- sometimes the publisher will contact the person and say, "We want to publish your story."
I'll tell you how I usually work as a ghostwriter.
There are a few agents and editors who know me well and refer clients to me often. They rep people who are not necessarily writers, but are celebrities or experts in some area. So, for example...
1. An agent read a front page article in the NY Times about bullying, and he liked the quotes from a guy who called himself the "Bully Coach." The agent contacted him and asked if he had thought about writing a book about bullying. The man was interested, but not really a writer-- so they worked on a draft of a book proposal, then hired me to finish the proposal and be the ghostwriter if/when the book sold. I was paid a fee for the proposal, and we had a contract that stipulated what I would be paid from the future advance and royalties. This is a leap of faith because they don't know what kind of advance and royalties they'll get at that point, so they're making the assumption that it'll be high enough to cover my fees and leave something for the expert and the agent.
2. In other cases, I'm brought in after the proposal has already sold and they know what kind of deal they have. The agent and expert have muddled through the proposal together, or hired a writer just to do a proposal, and sold it on that basis. The publisher generally knows they're going to use a ghostwriter-- or, in one particular case, the experts didn't think they needed a ghostwriter, but the editor insisted they did (and recommended me). She liked the subject matter and the idea of the book very much based on the proposal they turned in, but the writing was not professional. So she made them an offer contingent on their hiring a ghostwriter. Then they know that they have an advance of, say, $50,000, and can negotiate with me to figure out what's fair for both parties. (In some cases, I get a flat fee only; in others, I share in the royalties. In some cases, I get a cover credit, and in others, I don't.)
3. In other cases, I'm hired to write the proposal with an *option* to write the book itself, if we can agree on terms to be decided later (depending on what kind of deal the agent can get for the book).
In most cases, the $$ is not coming out of the expert/celeb's pocket, except possibly for the book proposal. They get paid by the publisher, then cut me a check for my percentage of that money. In a couple of cases, I'm listed and treated as a co-writer, and the publisher just sends us split checks (sending me my portion, and the expert/celeb his/her portion, usually through the agent).
But, no, professional ghostwriters don't work on spec except in very rare instances (I might do a proposal on spec if I know darn well it's going to sell for big bucks, and if I have a contract with the expert/celeb stating that I am to be the writer for the book, with minimum fees outlined in the contract).
Darn. Gotta run. I'll try to check back later and finish my thoughts.