In a 1980 interview, Gordimer stated that she was fascinated by the role of "white hard-core Leftists" in South Africa, and that she had long envisaged the idea for Burger's Daughter. Inspired by the work of Bram Fischer, she published an essay about him in 1961 entitled "Why Did Bram Fischer Choose to Go to Jail?" Fischer was the Afrikaner advocate and Communist who was Nelson Mandela's defence lawyer during his 1956 Treason Trial and his 1965 Rivonia Trial. As a friend of many of the activist families, including Fischer's, Gordimer knew these families' children were "politically groomed" for the struggle, and were taught that "the struggle came first" and they came second. She modelled the Burger family in the novel loosely on Fischer's family, and Lionel Burger on Fischer himself. While Gordimer never said the book was about Fischer, she did describe it as "a coded homage" to him. Before submitting the manuscript to her publisher, Gordimer gave it to Fischer's daughter, Ilse Wilson (née Fischer) to read, saying that, because of connections people might make to her family, she wanted her to see it first. When Wilson returned the manuscript to Gordimer, she told the writer, "You have captured the life that was ours." After Gordimer's death in July 2014, Wilson wrote that Gordimer "had the extraordinary ability to describe a situation and capture the lives of people she was not necessarily a part of."
Gordimer's homage to Fischer extends to using excerpts from his writings and public statements in the book. Lionel Burger's treason trial speech from the dock is taken from the speech Fischer gave at his own trial in 1966. Fischer was the leader of the banned SACP who was given a life sentence for furthering the aims of communism and conspiracy to overthrow the government. Quoting people like Fischer was not permitted in South Africa. All Gordimer's quotes from banned sources in Burger's Daughter are unattributed, and also include writings of Joe Slovo, a member of the SACP and the outlawed ANC, and a pamphlet written and distributed by the Soweto Students Representative Council during the Soweto uprising.
Gordimer herself became involved in South African struggle politics after the arrest of a friend, Bettie du Toit, in 1960 for trade unionist activities and being a member of the SACP. Just as Rosa Burger in the novel visits family in prison, so Gordimer visited her friend. Later in 1986, Gordimer gave evidence at the Delmas Treason Trial in support of 22 ANC members accused of treason. She was a member of the ANC while it was still an illegal organization in South Africa, and hid several ANC leaders in her own home to help them evade arrest by the security forces.
The inspiration for Burger's Daughter came when Gordimer was waiting to visit a political detainee in prison, and amongst the other visitors she saw a school girl, the daughter of an activist she knew. She wondered what this child was thinking and what family obligations were making her stand there. The novel opens with the same scene: a 14-year-old Rosa Burger waiting outside a prison to visit her detained mother. Gordimer said that children like these, whose activist parents were frequently arrested and detained, periodically had to manage entire households on their own, and it must have changed their lives completely. She stated that it was these children who encouraged her to write the book.
Burger's Daughter took Gordimer four years to write, starting from a handful of what she called "very scrappy notes", "half sentences" and "little snatches of dialogue". Once she got going, she said, the writing became an "organic process". The Soweto riots in 1976 happened while she was working on the book, and she changed the plot to incorporate the uprising. Gordimer explained that "Rosa would have come back to South Africa; that was inevitable", but "[t]here would have been a different ending". During those four years she also wrote two non-fiction articles to take breaks from working on the novel.
Gordimer remarked that, more than just a story about white communists in South Africa, Burger's Daughter is about "commitment" and what she as a writer does to "make sense of life". After Mandela and Fischer were sentenced in the mid-1960s, Gordimer considered going into exile, but she changed her mind and later recalled "I wouldn't be accepted as I was here, even in the worst times and even though I'm white". Just as Rosa struggles to find her place as a white in the anti-apartheid liberation movement, so did Gordimer. In an interview in 1980, she said that "when we have got beyond the apartheid situation—there's a tremendous problem for whites, unless whites are allowed in by blacks, and unless we can make out a case for our being accepted and we can forge a common culture together, whites are going to be marginal".