“Mac” — or Satyandranath Ragunanan Maharaj — had spent nearly 40 years as an anti-apartheid activist, much of it in exile and some of it underground or in detention in South Africa, as well as a further five in government. “Shades of Difference,” by Padraig O’Malley, the John Joseph Moakley professor for international peace and reconciliation at the University of Massachusetts, Boston, is a collaborative biography, bringing together the author’s analysis and Maharaj’s own reflections, transcribed from hours of interviews. The result is exactly what O’Malley set out to achieve: “a portrait of Mac and of South Africa.” It is a striking success.

Maharaj was born in 1935, to Hindu parents in Natal. An earlier generation had been shipped from colonial India during the 19th century as indentured labor for South Africa’s cane fields. Mac wanted to read for a law degree, but his skin color was against him. As a fervent young Marxist with a hatred of apartheid, he was skeptical about nonviolence at a time when many, including Mandela’s organization, the African National Congress, still favored it. “I took to Communism,” he tells O’Malley, “like a fish to water.”...

[After studying law in London and after a stint in East Germany,] he returned to South Africa, O’Malley explains, to lead a knife-edge existence as “the struggle’s publisher and bomb maker,” a member of the party’s central committee and also of the military wing of the A.N.C. He made pipe bombs, printed pamphlets and spirited militants out of the country for combat training. But the circle was tightening, and in 1964 he was arrested.

O’Malley, who provides a very good sense of the political context, tells us that from about 1960 until Mandela’s release in 1990, some 80,000 people were detained without trial....Mac was charged with four counts of sabotage. On Robben Island he quickly fell in with Mandela and the other political prisoners.