The title of the book comes from a line in the Josephine Davis translation of the poem "Kabul", by the 17th-century Iranian poet Saib Tabrizi:
- "Every street of Kabul is enthralling to the eye
- Through the bazaars, caravans of Egypt pass
- One could not count the moons that shimmer on her roofs
- And the thousand splendid suns that hide behind her walls"
In an interview, Khaled Hosseini explains, "I was searching for English translations of poems about Kabul, for use in a scene where a character bemoans leaving his beloved city, when I found this particular verse. I realized that I had found not only the right line for the scene, but also an evocative title in the phrase 'a thousand splendid suns,' which appears in the next-to-last stanza."
When asked what led him to write a novel centered on two Afghan women, Hosseini responded:
"I had been entertaining the idea of writing a story of Afghan women for some time after I'd finished writing The Kite Runner. That first novel was a male-dominated story. All the major characters, except perhaps for Amir's wife Soraya, were men. There was a whole facet of Afghan society which I hadn't touched on in The Kite Runner, an entire landscape that I felt was fertile with story ideas...In the spring of 2003, I went to Kabul, and I recall seeing these burqa-clad women sitting at street corners, with four, five, six children, begging for change. I remember watching them walking in pairs up the street, trailed by their children in ragged clothes, and wondering how life had brought them to that point...I spoke to many of those women in Kabul. Their life stories were truly heartbreaking...When I began writing A Thousand Splendid Suns, I found myself thinking about those resilient women over and over. Though no one woman that I met in Kabul inspired either Laila or Mariam, their voices, faces, and their incredible stories of survival were always with me, and a good part of my inspiration for this novel came from their collective spirit."
"I hope the book offers emotional subtext to the image of the burqa-clad woman walking down a dusty street in Kabul."—Khaled Hosseini in a 2007 interview.
Hosseini disclosed that in some ways, A Thousand Splendid Suns was more difficult to write than his first novel, The Kite Runner. This is partly because when he penned The Kite Runner, "no one was waiting for it." He also found his second novel to be more "ambitious" than the first due to its larger number of characters, its dual focus on Mariam and Laila, and its covering of a multi-generational-period of nearly forty-five-years. However, he stated, "As I began to write, as the story picked up pace and I found myself immersed in the world of Mariam and Laila, these apprehensions vanished on their own. The developing story captured me and enabled me to tune out the background noise and get on with the business of inhabiting the world I was creating." The characters "took on a life of their own" at this point and "became very real for [him]".
Similar to The Kite Runner, the manuscript had to be extensively revised; Hosseini divulged that he ultimately wrote the book five times before it was complete. The novel's anticipated release was first announced in October 2006, when it was described as a story about "family, friendship, faith and the salvation to be found in love".