After the Trojan war, Odysseus sets off on his journey back to Ithaca. He survives encounters with the Lotus Eaters and Sirens only to face another challenge: the homecoming. What can Homer's epic poem tell us about how soldiers cope when conflicts end?

Last month, the 7th Armoured Brigade, the "Desert Rats", arrived at Camp Bastion in Helmand: the last major deployment to Afghanistan before the UK pulls out its combat troops at the end of next year. Britain's wars, for now, are coming to an end. But what does that ending mean for the soldiers coming home? David Finkel, author of Thank You for Your Service, a new account of the travails of the returning warrior, puts it brutally: it means coming "out of one war into another".

Homer's Iliad is the first and greatest poetic account of the first type of war. But it is the Odyssey that takes on the second kind: the war of the homecoming.

The Odyssey is a poem that we tend to remember as the hero's colourful, salt-caked adventures on the high seas: his encounters with witches, nymphs and cyclopes, his journey to the land of the dead, his shrewd and quick-tongued and fast-witted outsmarting of the terrors in his path as he strives for a decade to reach his home after the sack of Troy. He drags his crew bodily away from the island where the inhabitants gorge themselves on the memory-wiping, pleasure-giving lotus; he withstands the ruinous song of the Sirens, who long to lure him to his death, by having himself lashed to the mast by his crew, whose ears he has stopped with wax; he outwits the glamorous enchantress Circe, who turns his men into pigs; he steers his ship between the maneating, many–headed Scylla and the deadly whirlpool Charybdis. He is the original unlikely survivor, the man who always struggles free of the car crash and walks clear of the wreckage as the flames curl out: the latest iteration of the type, which runs through storytelling from archaic Greece to Hollywood, is Sandra Bullock's character in Alfonso Cuarón's blockbuster, Gravity.

But, as Aristotle put it in the Poetics, these are "episodes". The essence of the story is that of a veteran combatant who, after a long absence, must find his way back into a household he finds threatened by outside forces and dangerously altered.

He is at first unrecognisable to his wife (he has come back "a different person" – literally, in that he has disguised himself and assumed a false name, but military spouses will understand the metaphor of the warrior utterly changed by war). The necessary process of recognition and reintegration is accomplished, but only violently, painfully. And so the Odyssey speaks urgently to our times. It did, too, in the post-Vietnam era, when the psychologist Jonathan Shay, who worked with veterans of the conflict, used the epic in his book Odysseus in America as the overarching metaphor for the postcombat warrior's psychic traumas.

The Odyssey invites us to ask: can soldiers ever, truly, return home? Will they "recognise" their family, and vice versa? Can they survive not just the war itself, but the war's aftermath? Will they, in some dread way, bring the war home with them? The Odyssey says: you thought it was tough getting through the war. Now, see if you can get through the nostos – the homecoming.

The invisible, interior wounds of veterans have long been recognised. Ben Shepard, in his book A War of Nerves, has charted their diagnosis, from the "shell shock" of the first world war to the "nerve problems" of the second, through to the naming of post-traumatic stress disorder (PTSD) by American psychiatrists in the troubled aftermath of Vietnam. It is now estimated that 20%-30% of the two million US soldiers deployed in Iraq and Afghanistan have come home with post-traumatic stress disorder or traumatic brain injury (TBI). "Depression, anxiety, nightmares, memory problems, personality changes, suicidal thoughts: every war has its after-war," Finkel writes, "and so it is with the wars of Iraq and Afghanistan, which have created some 500,000 mentally wounded American veterans."

Sing to me, Muse, of that endlessly cunning man

who was blown off course to the ends of the earth, in the years

after he plundered Troy. He passed through the cities

of many people and learned how they thought, and he suffered

many bitter hardships upon the high seas

as he tried to save his own life and bring his companions

back to their home. But however bravely he struggled,

he could not rescue them, fools that they were – their own

recklessness brought disaster upon them all...

The first line of the Odyssey, here in Stephen Mitchell's newly published translation, lands on "man": in the original Greek it is "andra" – man – that is the very first word of the epic. The Odyssey is an intensely human story. It is Odysseus' intelligence and above all, his capacity to endure, that finally sees him reinstalled on his throne, reunited with his wife and son.

The poem is as full of twists and turns as the questing mind of its hero. Unlike the Iliad, which is a straightforwardly linear narrative, telling of the rage of Achilles and the killing of the Trojan prince Hector, the Odyssey is conveyed through flashbacks and narratives-within-narratives, and in a range of exotic, sometimes supernatural, locations. Along the poem's dizzying pathways we are constantly reminded of what this story might have been if Odysseus' intelligence and self-control had been a degree meaner.

In the first few books of the poem, there are frequent references to another homecoming from Troy – that of the Greeks' victorious commander-in-chief, Agamemnon. This story inserts itself again and again into the early passages of the Odyssey: how Agamemnon came back to his kingdom, and how his wife Clytemnestra's lover, Aegisthus, murdered him. And then how Orestes, Agamemnon's son, avenged his father by killing both his mother and her lover. The insistent intrusion of this story into the Odyssey fulfils twin roles. For Odysseus' son Telemachus, it acts as a prompt: can the young man, unschooled in war, become the kind of hero that Orestes was – the true son of his father? But it also works as a warning for all that might go wrong for Odysseus. It tells us this: unless you play things right, you'll be destroyed at home – even though you won the war.

Odysseus is no fool. He does not return to his kingdom ostentatiously, as Agamemnon did. Fittingly for the warrior who invented the Trojan horse, who is skilled in subterfuge and military intelligence, he sneaks in, disguised in rags. He goes not to his own palace, but to the cottage of Eumaeus, a swineherd. He does not reveal his identity, even to the loyal old man. Then, posing as a beggar, he slips into his house, at once spying on the suitors who swarm around Penelope, and testing his wife and household's loyalty.

Penelope is indeed strong and true: she has kept the suitors at bay for a decade. In Finkel's book there is a heartrending story of a war widow who, though she keeps her husband's ashes close, is at some level convinced he is alive and nearby, preparing to come back home, but biding his time; she waits patiently, loyally. It is a kind of inverse Penelope story; it reminds me of Zachary Mason's dazzling novel of Homeric what-ifs, The Lost Books of the Odyssey, which unwinds skeins of alternative narratives, releasing counterstories as if they were somehow already implicit in the epic (Odysseus returns to find his wife remarried, or dead; Achilles is a golem fashioned by Odysseus, and so on).

What happens next in the Odyssey is this. Penelope, under increasing pressure to choose a husband from among the suitors, sets them a challenge. Whoever can string the great bow of Odysseus, left behind for 20 years, and shoot an arrow through the 12 axe heads that Telemachus sets out, shall win her as his bride.

Odysseus killing the suitors of his wife Penelope. Photograph: Culture Club/Getty Images

In turn, the suitors try the task, and fail. Odysseus, wrapped in filthy rags, the butt of the suitors' contempt, stands up to attempt the feat. Easily, he strings the bow and flies an arrow, swift and shrill as a swallow, through the axe heads. Then, without a beat, he takes another arrow and switches his aim to one of the suitors' ringleaders, Antinous, who is tilting a goblet to his lips. Odysseus gets him right through his exposed neck: in one side, out the other, and the blood fountains forth. Then the bloodbath begins – or rather, a battle, the war brought literally home. The remaining suitors get their hands on weapons. Odysseus, aided by Telemachus, engages them. The father and son are vastly outnumbered: but they have a god on their side. Athene, in human disguise, weighs in. Soon the great hall is a charnel house.

Afterwards, Telemachus orders the disloyal maids to clean up the bodies and the gore. Then he takes them outside and hangs them. They twitch helplessly in their death throes, like thrushes in a snare. Shay, in his Odysseus in America, reads the episode as a kind of fantasy or wish fulfilment: it is warrior's rage vented on the civilian who has stayed comfortably behind, an eye on his wife. In Finkel's book there is a veteran who, after an injury, has no sensation or movement on his left side. Out and about, he wears a specially printed T-shirt. On the front it reads: "What have you done for your country?". On the back: "I took a bullet in the head for mine" – a gesture of suppressed fury if ever there was one.

❦

In the Odyssey, people tell each other stories about the war. Penelope hears the bard Phemius singing about how the other Greek war leaders found their way home after the sack of Troy, but she can't bear it and asks him to stop: it is too cruel a song when her own man is still unaccounted for. When Telemachus, prompted by the goddess Athene, leaves Ithaca and goes in search of his father, he arrives at the court of Menelaus and Helen: Menelaus tells him the tale of Agamemnon's return, a story so grievous that all of the listeners, each remembering his own war losses, weeps. When Odysseus himself ends up in the land of the Phaeacians, his last adventure before he finally reaches his homeland, he conceals his true identity. Entertained at the royal court, he asks the blind bard, Demodocus, to sing of the exploits of the Greeks at Troy. He does so (in the late Robert Fagles' translation):

but great Odysseus melted into tears,

running down from his eyes to wet his cheeks…

as a woman weeps, her arms flung round her darling husband,

a man who fell in battle, fighting for town and townsmen,

trying to beat the day of doom from home and children.

A US soldier embraces his girlfriend after arriving home from Iraq. Photograph: John Moore/Getty Images

Thus the great warrior's remembered pain is made equal to that of the war widow.

❦

Telling stories about the war is also one way of understanding the nature of Greek tragedy, the art form that matured in Athens some 200 years after the Homeric epics were written down. The earliest playwright whose works survive complete is Aeschylus. His trilogy, the Oresteia, first performed in 458BC, is an expansion of the story of Agamemnon's return, taking its cue from the Odyssey. Reading Homer, you see how the poet opens the door to the tragic form – over half of the poem's lines are in direct speech and the scenes that describe the performances by bards such as Demodocus and Phemius suggest that epics would have been performed to an audience, with music, as part of an evening's feasting and entertainment.

Like the Oresteia, many of the works of the tragedians are sequels or prequels to the stories of the Trojan war, tying up the epics' loose ends, spiralling out from their stories to go down narrative byways of their own making. Euripides' Iphigenia in Aulis, for instance, tells the story of how Agamemnon sacrificed his own daughter to ensure a fair wind to set his fleet on course for Troy. His Trojan Women tells of the fate of Hecuba and Andromache, enslaved after the war by the victorious Greeks. In Sophocles' Ajax, the hero is enraged that the god-forged armour of (the now dead) Achilles is bequeathed to Odysseus, not to him. He vows to kill the Greek leaders – but is sent mad by Athene, and massacres livestock instead of men, before committing suicide.

It is no coincidence that this last drama has, over the past weeks, been staged in London, rewritten for our times as Our Ajax by Timberlake Wertenbaker. Suicide is now as threatening to soldiers as bombs and guns. Finkel's book includes an account of a meeting of the Suicide Senior Review Group, a regular gathering of top US army officers to examine the previous month's shattering litany of soldiers' self-shootings, hangings, overdoses and plunges from bridges. A report published this February by the Department of Veteran Affairs found that, in 2010, 22 US veterans killed themselves every day, while in the UK more soldiers and veterans killed themselves in 2012 than died in combat in Afghanistan.

The causes of war, the collateral damage of war, the ghastly aftermath of war, the devastating impact of war on the self: this is Greek tragedy's stock in trade. The first audiences of these plays were, too, steeped in war. In the 480s BC, Athens and Sparta came together to head a small, shaky alliance of Greek city-states and withstood an invasion by Persia – though not before Athens had been burned to the ground, twice. In the years following the victory, Athens pursued a policy of aggressive imperial expansion and overseas intervention, culminating in the outbreak of the Peloponnesian war with Sparta in 431, which lasted, on and off, until 404.

Athens' army consisted of its citizens. None was untouched by war. Even that most pacific of philosophers Socrates had served in the Athenian army and – we learn in Plato's Symposium – saved the life of Alcibiades at the battle of Potidaea in 432 BC. The City Dionysia, the festival at which the plays were performed, included a parade of the children whose fathers had been killed in combat. The playwrights themselves were militarily embroiled, in one way or another: Aeschylus fought at Salamis, the decisive naval battle of the Persian wars; his brother, according to Herodotus, was killed in it. Sophocles took high office as a general. Euripides, it was later claimed, was born on the day of the battle of Salamis itself, and his plays have been interpreted as responses to the fraught, bloodsoaked events of the war against Sparta: the civilian massacres, the grievous loss of men and morals.

Thus the tragedies provided a communitarian context for telling stories about conflict and its effects. According to Edith Hall, professor of classics at King's College London, this direct expertise gave Greek authors the ability to discuss "the cost of war in terms of the mental health of combatants" with a "frankness and sophistication from which we can learn a great deal in the third millennium". The tragedians, she argues, were experts in what we would now term PTSD.

Exhibit A in this argument is Euripides' extraordinary play Heracles Mainomenos – "Heracles Being Mad". Until about two thirds of the way through the drama, its narrative is rather conventional. Heracles' wife, children and mortal father Amphitryon (the man who brought him up, though the hero is the son of Zeus) live in fear for their lives; their enemy is a usurping tyrant, Lycus. Heracles has been absent, fighting and performing his 12 labours. Now he returns and, reunited with his loving family, prepares to save the day.

Except a goddess called Lyssa appears and causes Heracles to lose his mind. The hero turns on his wife and children, supposing them to be his foes. He uses his bow against his first child, then clubs the next to death. As his wife tries to save the third, he kills them both with a single arrow. The episode passes: Heracles becomes aware of what he has done, and is utterly broken.

Who is Lyssa? She is madness. Not a generic madness, for Greek authors punctiliously identified varieties of disordered minds. For example, the ecstatic mania sent by Dionysus is different from the hallucinations sent by the Erinyes, the Furies who torture Orestes after his matricide. Lyssa, according to Hall, is "personified combat-craziness": the madness of the berserking soldier. Lyssa can, Hall has written, "attack arbitrarily, force entry into the body even of a superhero, send him into a wild state with physical symptoms of derangement, terrify him, wreck his cognitive skills, and make him destroy the things he loves the most". Lyssa is animalesque: she might be dog-faced, or likened to a snake-haired Gorgon. Unleash the dogs of war, and you unleash Lyssa. When Heracles is sent mad by Lyssa, he becomes "Gorgon-eyed" and "like a bull"; he "shakes his wild-eyed Gorgon face".

Poet Anne Carson's translation of part of one of Heracles' last speeches (in her Grief Lessons: Four Plays by Euripides) captures the link between the violence in his heroic life (the labours, the wars) and its dreadful eruption into the home:

All those labours,

what can I say? Those lions.

Those typhons.

Those giants.

Those centaurs.

Those wars.

Then the hydra with her hundred heads snapping.

And down to hell to get the threeheaded dog.

And now, absolutely last labour.

I kill my children.

I finish my house in evil.

There are uncanny and disturbing echoes of this kind of domestic fury in Finkel's book. One wife keeps a secret diary of her husband's outbreaks of rage, charting how a once polite and loving man descends into a screaming tyrant ("I'm going to break every knuckle of your consciousness") before she flees their home with her child. Of one veteran, he writes: "He has a young daughter who was in the family truck one day when he all of a sudden went haywire, punched the rearview mirror, shattered the windshield, grabbed [his wife] by the top of her head, shook her back and forth, and screamed, 'I'm gonna fucking kill you.'" Another man chokes his wife in his sleep; he wakes up and has no memory of the attack, but her neck is bruised and sore.

Long-enduring, ever-devising Odysseus manages to fulfil the last great quest, the last labour that defeats even Heracles: he is able to return safely home. Penelope is the key. She is his match: a woman of wiles, long-enduring, just like her husband. In a ruse worthy of Odysseus himself, she tricks her suitors: she will make a decision, she says, when she has finished weaving her father's shroud. Every day, she weaves. And every night, she unravels.

After the massacre of the suitors, Odysseus reveals his identity to Penelope. But she does not recognise him, yet – or feigns not to. Telemachus berates his mother – how can you be so hardhearted, when he's been away for 20 years? Odysseus smiles. Leave us alone together, he says.

Penelope orders the marital bed to be brought out on to the terrace. Odysseus is furious. Who could move my bed, he asks. Impossible: it is carved from a living olive tree. (A wonderful image: the marital bed that grows and lives, rooting down through the house.) Now, at last, Penelope can truly believe it's him: no one else on earth, aside from his old nurse Eurycleia, knew about that immovable olive-tree bed.

Joy, warm as the joy that shipwrecked sailors feel

when they catch sight of the land – Poseidon has struck

their well-rigged ship on the open sea with gale winds

and crushing walls of waves, and only a few escape, swimming,

struggling out of the frothing surf to reach the shore,

their bodies crusted with salt but buoyed up with joy

as they plant their feet on solid ground again,

spared a deadly fate. So joyous now to her

the sight of her husband, vivid in her gaze,

that her white arms, embracing his neck

would never for a moment let him go ...

So is Penelope's elation, in Fagles' translation, conjured. The poet likens her to a shipwreck survivor, just as her husband has really been, over and over again. When a tearful Odysseus was listening to Demodocus' stories of the Trojan war, his grief was compared to that of a war-widowed woman who flings her arms around her fallen husband. So are the experiences of these two, man and wife, intertwined, made the same by the poet. There is recognition of the importance of this – the equality of experience and of pain – among the long-enduring wives in Finkel's book. One in particular identifies the possibility of healing in her husband's coming to see that "he could tell her anything about the war, anything at all. That she wanted to hear it. That she could take it."

At the end of the poem, Odysseus and Penelope go to bed, they loosen their limbs in love, and tell each other stories about the war.