THE HISTORY of apartheid, comparatively recently ended in South Africa, weighs heavy in the work of two of that country’s foremost artists, currently exhibiting at the Fruitmarket.

Born in the 1950s, both grew up under apartheid, both were politically engaged. William Kentridge, the son of lawyers who represented Nelson Mandela when he was first imprisoned and Vivienne Koorland, who early on in her career illustrated the Xhosa-language dockworkers’ newspaper ABASEBENZI (worker), met some 40 years ago at university, he studying political science, she art at Cape Town.

Since that first meeting they have “long done their work in different ways, often coming from the same source or out of the same questions,” as Kentridge once said. This exhibition, drawing together mostly recent works that show the links between the two artists and curated by another university friend, Tamar Garb, is sobering and thought-provoking but with an occasional lightness that only serves to underline the political realities – past and present – which provoke the work.

Kentridge, who works in many media, but is here largely represented by the animations for which he is so well known. Recent works include Anatomy of Melancholy (2012), Tango for Page turning (2012) and Second Hand Reading (2013), but there are also moving early works such as Felix in Exile (1994). In his "book" films, the animation flicks randomly through the pages of a book or ledger as Kentridge’s beautiful expressive charcoal figures – he is a superb draftsman – dance or run over the opposing leaves. Kentridge’s hand rubs away applied whirls of paint from the ledgers to reveal an image underneath, suggesting both the attempts to take it all away, rub it away, “unremember”, but also the layers of history. He cleans up the mess in reverse, peeling back the many obscuring surface layers, but the mess simply reveals the thing hidden underneath.

Many images recur in these animations, from a dancing woman to megaphones, a string of barbed wire to a dead body, astronomical instruments to a running businessman, like leitmotifs for the twentieth century, for the long shadow of history.

Elsewhere, Kentridge’s luridly musical Notes Towards a Model Opera (2015) is a fast-moving three screen installation of agit-prop, of surreal, pointless slogans made from inflammatory words put together as if by chance, and a woman en pointe, dancing delicately with a gun and revolutionary red flags to tin-can jaunty music, like some guttural war spirit dressed-up as civilization. Men stare at sandwich-board placards around their necks with slogans, bemused, uncertain. And then suddenly they become the slogan, shouting it, impassioned. It is easy to get swept up in it, to bludgeon your own culture, your own people, Kentridge seems to fleetingly suggest, as images of Mao, of Castro, flit by on the screens.

Vivienne Koorland’s work, less well known in this country, is mounted on panels around the gallery, monumental in scale. It is her vast Pays Inconnu which confronts the visitor as they enter the ground floor gallery, a reworking of a hugely detailed eighteenth century map of South Africa made for King Louis XVI, depicting the journeys of explorer and ornithologist Francois le Vaillant. Koorland’s "copy" is produced on burlap sacking, laid out, stitched together and painted with idyllic images of animals and idealised pastoral images of peoples. Here and there, small panels are stitched on in patchwork fashion. In its non-specificity, it has the air of a fantasy map, a map of somewhere that doesn’t really exist. Here be giraffes or lions. Here be Nick, the artist’s dog. The map is as subjective as the cartographer producing it. It contrasts with another work some few paces away, the simple yet disturbing diptych of SA Farm Map: Settlements and SA Farm Map: Deportations (2008). Each contain a set of names mapped out on panels of burlap. The names are varied in the latter, but the former is nearly all Afrikaans, charting the displacement of people from their land.

It is the importance of words as a factor in both artists’ work that stands out. Kentridge prints messages on the existing words in the books he uses for his animations, from the ledgers of a South African gold mine, a symbol of capitalism and the oppressive history of apartheid, to the 17th century thesis The Anatomy of Melancholy. Kentridge’s animations frequently involve objects morphing into other things; a person carrying a heavy load spins on its axis to become a tree, dead bodies are covered by paper to become part of the landscape; a man running along is shadowed by abstact brush strokes running on the verso, the dark shadow from which he cannot get away. Landscape and history are key. Words repeat. “End with love.” “Unhappen.” “Unremember.” But Kentridge's work is the action of remembering and of dealing with those memories.

For Koorland, too, art is a process of remembering, of questioning. Sometimes she painstakingly paints out stories or accounts, including a first-hand anonymous typed account from a family, perhaps somewhere in Nazi Europe, perhaps elsewhere, in the months before they and their neighbours are taken off on a transport. And Koorland, too, paints on books, from book spine paintings to early "canvases" made from book pages and newsprint. Kentridge and Koorland record, just as the ledgers and books and accounts that they use in their work recorded. The commentary comes in the layers painted, animated and imagined, on top, and a history of violence, injustice and human sorrow dances across the pages.

William Kentridge and Vivienne Koorland: Conversations in Letters and Lines is at Fruitmarket Gallery, Edinburgh until February 19.

www.fruitmarket.co.uk