In March 1938, shortly before he began working on The Grapes of Wrath, John Steinbeck wrote to his agent Elizabeth Otis to turn down a commission to write about migrant workers.

“The suffering is too great for me to cash in on it … it is the most heartbreaking thing in the world,” he wrote. “I break myself every time I go out because the argument that one person’s effort can’t really do anything doesn’t seem to apply when you come on a bunch of starving children and you have a little money. I can’t rationalise it for myself anyway. So don’t get me a job for a slick.”

Then came the famous line: “I want to put a tag of shame on the greedy bastards who are responsible for this.”

There’s no avoiding the irony that The Grapes of Wrath would soon make Steinbeck one of the richest writers in the world. But there’s also no reason to doubt his sincerity. Instead of writing for a slick, he wrote for himself, knuckling down in the early summer of 1938, giving himself a 100-day deadline to write the novel that would provide that tag of shame. He wrote in a lined ledger at the rate of 10,000 words a week. He told a friend that he had never worked so hard – and intended to rip his “reader’s nerves to rags”.

He also shredded his own. “This must be a good book, it simply must. I haven’t any choice,” he confided in the diary he kept while writing. “For the first time I’m working on a real book that is not limited … It will take every bit of experience and thought and feeling that I have.”

The entries became increasingly fraught. “I hope I’m not heading for a nervous breakdown,” he wrote. And then: “My nerves are going fast … I wish I could go to a furnished room some place where I know no one and just disappear for a while. I wish that.” And then: “I’m afraid this book is going to pieces. If it does, I do too.”

On 26 October 1938, he wrote: “I am so dizzy I can hardly see the page.” Mercifully, later on that same day, he added: “Finished … and I hope to God it’s good.”

This furious effort has since passed into legend; not least because the urgency Steinbeck dedicated to his craft is so clearly replicated in the sincerity and passion of The Grapes of Wrath. But like plenty of legends, it doesn’t tell the whole truth: Steinbeck backed up his burst of creativity with a period of careful and calmer editing. And even though the book was written in a rapid fury, it had had a long genesis.

As that letter to his agent implies, Steinbeck had known about the sufferings of migrant workers for years. In 1936, he wrote a less famous novel called In Dubious Battle, inspired by the California agricultural strikes that had been going since 1933. His home town, Salinas, was also the site of a camp for workers in the nearby fields. In a case of life mirroring art, in September 1936 a pitched battle broke out there between the workers and, as Melvyn Bragg describes them, “the forces of agribusiness (stiffened by 250 proto-fascist American Legionnaires and 2,000 local vigilantes)”.

This event, in turn, helped Steinbeck win the commission to write a series of articles for the San Francisco News titled The Harvest Gypsies – and so took him still deeper into that world. He visited Weedpatch Camp, which eventually featured in The Grapes of Wrath. As well as speaking to people there, he was given vital research materials by the camp’s manager, Tom Collins. Many of these documents were custom built for a novelist, having been given to Collins by Sanora Babb, who was planning her own book about the migrants. (In a cruel twist, Babb’s book was pulled from publication because her publisher feared it would get no attention after the success of The Grapes of Wrath.)

In the first piece for the San Francisco News, Steinbeck describes the plight of families fleeing the Dust Bowl, who, “arrive in California usually having used up every resource to get here, even to the selling of the poor blankets and utensils and tools on the way to buy gasoline. They arrive bewildered and beaten and usually in a state of semi-starvation, with only one necessity to face immediately, and that is to find work at any wage in order that the family may eat.”

He described people who had lost their homes, their livelihoods, their sense of worth. “Dignity is all gone,” he wrote, “and spirit has turned to sullen anger before it dies.” He spoke to people who had lost loved ones, and women whose children had died because they were unable to produce the milk to feed them. One passage describes a toddler, belly swollen with malnutrition, beset by flies that “try to get at the mucus in the eye-corners. This child seems to have the reactions of a baby much younger. The first year he had a little milk, but he has had none since. He will die in a very short time.”

In The Harvest Gypsies articles, Steinbeck wrote in direct, matter-of-fact journalese. You can almost sense him holding himself in; it would have been surprising if Steinbeck hadn’t gone on his furious subsequent writing binge. But it still feels fortunate for us that he did – even if he was initially disappointed. Soon after he finished writing, Steinbeck declared: “It isn’t the great book I had hoped it would be. It’s just a run-of-the-mill book.” A year later, it won the Pulitzer prize. Eighty years on, it’s sold more than 14m copies.