The Islamic State group wasted absolutely no time in boasting of its 'triumph' on Thursday evening.

With the dead, the dying and injured still scattered across Las Ramblas, and thousands of people in lockdown in bars, cafes and restaurants in fear for their lives, it announced via social media that its 'soldiers' were responsible for the carnage in Barcelona, and another attempted atrocity in the coastal town of Cambrils.

It is a grim modus operandi we've become used to.

In the immediate aftermath of the Manchester Arena bombing in which 22 people died, and the attacks on Westminster (five deaths) and London Bridge and Borough Market (eight), IS was busy trumpeting its role.

As its brutal grip over large areas of Syria and Iraq is being demolished, the group is determined to show it is still in the terror business and able to inspire far-flung sympathisers.

Profile and propaganda have always marked out IS. Its members see themselves as the modern, edgy re-incarnation of the dusty, cave-dwelling old men of Al Qaeda — a new breed, the hipsters of the terror-sphere.

That's part of its appeal and why an early trickle of recruits turned into tens of thousands of Muslims — men and women, mainly young but from an array of national, ethnic, social and educational backgrounds.

Scroll down for video.

Channel 4's new drama, The State,airs over four consecutive nights starting tomorrow. It follows four young Britons who leave home for the Syrian town of Raqqa, Islamic State's 'capital', and explores their differing experiences of daily life there

A scene from episode one Sam Otto as Jalal (left) and Ryan McKen as Ziyaad (right)

Shavani Seth stars as Ushna in director, Peter Kosminsky's The State on Channel Four

They flocked to what they saw as a new country, ruled by truly Islamic laws, carved from the ruins of Syria which would spread out across the Middle East. And about 850 of those who went to Syria are from the UK.

They weren't just going to fight, they were going to provide the new human infrastructure of a state — the teachers, doctors and engineers. That was their vision, their version.

However, what the rest of the world saw were the stomach-churning films that IS produced to Hollywood standards of camera work, soundtrack and graphics to portray their horrific but brilliantly choreographed mass-beheadings, torture and enslavement of those who didn't share their beliefs.

Many of those enthusiastic migrants to IS have now been killed. Plenty of the survivors are now desperate to come home, to cities and villages across Britain, as well as to another 50 countries from which they were recruited.

Will they return miserable and disillusioned, wanting a quiet return to their old lives, having witnessed first-hand how IS perverted the true nature of Islam?

Or are they a threat, still dedicated to the cause and ready to ram lorries into crowds, bomb pop concerts or blow themselves up to show their ongoing rage at what they see as a debauched Western society governed by unholy man-made laws?

Does the sinister upsurge in attacks this year in Britain, France and now Spain mean that we just can't take the risk, and all returnees must be locked up as terrorists?

It is a problem that Western governments and intelligence agencies are only beginning to grapple with.

So Channel 4's much-heralded new drama, The State, which airs over four consecutive nights, starting tomorrow, is timely.

It follows four young Britons who leave home for the Syrian town of Raqqa, Islamic State's 'capital', and explores their differing experiences of daily life there.

Ony Uhiara as Shakira (left) and Nana Agyeman-Bediako as Isaac in episode one of The Sate

Fiction, yes, but all based on fact and extensive research according to the writer and director, Peter Kosminsky, who says he wanted to 'humanise' those who signed up and give an insight into their motives.

Kosminsky makes beautifully crafted films for cinema and TV: from the 2015 multi-award-winning adaptation of Hilary Mantel's Tudor masterwork Wolf Hall to his recreation of real events in The Government Inspector, telling the story of the Iraq 'dodgy dossier' and the mysterious death of government weapons expert, Dr David Kelly. In The State, Kosminsky gives us Shakira, an intelligent, assertive doctor and devoted single parent to her nine-year-old Isaac.

Shakira speaks fluent Arabic, has an in-depth knowledge of Islamic law and religious practice, and decides her talents are best served if she and her son go to help build the new Caliphate (an area under the control of a Muslim ruler).

We learn nothing of Shakira's background, only that she's a British-born black Londoner. Whether she's a convert to Islam or not is never made clear. Indeed, we're not told much about the backgrounds of any of the key characters — which I think is one of the main failings in this drama.

We learn a little more about Jalal. He's a 'hafiz', meaning he's memorised the 80,000 words of the Quran. He goes to Syria to find out how his brother died there, travelling with his friend Ziyaad. Both are London lads from British-Pakistani backgrounds.

The fourth character is teenager Ushna, who has been radicalised on the internet and goes to fulfil what she sees as her religious duty in Raqqa.

Because we see nothing of the quartet's lives pre-Raqqa, it's hard as a viewer to understand what really led them there. Yes, there are tiny clues buried as the series progresses, but they are easily missed.

When Jalal's father turns up in Raqqa, to beg him to return home, he tells him in a tear-sodden speech that he and his wife came to Britain so their children could be born and benefit from life here — not to lose two sons in a foreign conflict. But beyond this there is little to properly put the lives of the protagonists in context, to understand them as Kosminsky wants us to.

What is not spelled out, as I know from my own research over 20 years, is the all-too-common backstory of those who have joined IS; the British-born second generation Muslims who have grown up in relatively non-religious homes, with the emphasis on education, good jobs and fitting into a new culture.

Many of these youngsters struggled to find their own identity and experienced racism. This, coupled with a limited grasp of Islam, meant they were easy prey for radical preachers, who could fill them with a hate-filled ideology and send them off to kill unbelievers.

Jalal and Ziyaad join two other battle-hardened Britons already in Raqqa. We see them larking about in the swimming pool and describing elements of life in Raqqa as 'sick — teen-speak for 'really cool' — before shots of them making stilted speeches to a camera ahead of conducting executions.

That is Kosminsky's nod to the so-called 'Beatles', the four Britons, including 'Jihadi John', who were 'stars' of IS propaganda videos that glorified in the torture and beheading of Western hostages.

In fact, Kosminsky has been so rigorous in his search for authenticity that many scenes were horribly familiar to me. They were virtually identical to the IS videos I'd spent months watching in 2014 and 2015 while making a documentary on the lives of some of those who'd joined Islamic State from Australia and Southeast Asia.

That was the heyday of the terror group. There was a joyous camaraderie among the recruits as IS captured more and more territory. Taking selfies, blogging and featuring in set-piece propaganda films was all part of their routine.

The scene in The State where new recruits practise rescuing an injured colleague, belly-crawling through the dirt, while live rounds are fired either side of them is an accurate recreation of a widely watched IS video.

So, too, are the scenes where IS fighters hand out sweets to local kids and clearly terrified adults are interviewed about how 'welcome' Islamic State is in their town.

The trucks churning up the desert, with the black banner of IS flying above the mounted machine guns. The orange-clad prisoners kneeling in front of a masked executioner brandishing a serrated knife.

All of these were carefully staged scenarios filmed by IS as an influential part of their internet recruitment process.

In The State, the characters are indeed humanised. However, this is to such a degree that there's a danger some vulnerable youngsters, already half-blinded by propaganda, don't see the difference between what's freely available online and a drama on TV, where men become warriors for their faith and women fulfil their destiny by bearing children for husbands then martyred in battle.

We already know that the real-life counterparts have indeed been powerful role models.

Shakira, the doctor in The State, is in many ways similar to a real-life doctor I tracked for my documentary, who blogged anonymously under the name Shams, which is Arabic for sun.

And what a ray of IS sunshine she was, posting a potent mix of soap opera, travel guide and extremist rhetoric. In Raqqa, she married a Moroccan fighter — cue soppy love poems and flowers on her blog. Then he went missing in action and she posted a scan of their unborn child. Hundreds of young women messaged their support, eager to know what happened next and yearning to follow her to Syria.

She told them about the wonderful life they could have, with free houses and food.

In the documentary we revealed Shams to be a Malaysian woman, Shameem Banu. I spent time with her family, who were devastated at her actions and equally fearful about her dying in Syria or returning to be locked up for life in Malaysia. Shams is now silent. Alive or dead, I don't know.

There are no happy endings for the young Britons in The State, but then you wouldn't expect that, of course.

What I as a viewer really needed to know — and what the drama failed to tell me — is what was so awful about life here in the UK that they would give up everything for a one-way ticket to Syria. For me, Kosminsky's drama, while brilliantly acted and powerfully made, failed to illuminate the motives of the characters. This is despite the 18 months of meticulous research that went into writing it.

Delving deeper could have helped viewers put the actions of those who responded to the call of IS into context.

This is important because every terrorist attack increases the need to understand the warped rationale of the Britons and other nationalities who have joined Islamic State in real life, and of those who have stayed at home, cheering the blood-soaked images from Barcelona.

Because it is only by understanding this that we can begin to unpick it and prevent others from taking the same path — and also properly assess the threat posed by those coming home.

Today Islamic State is waning — but it is certainly a long way from being defeated.

Its heartland is shrinking and the supply of new recruits is drying up. But the attacks in Britain and Europe by sympathisers, and possibly returnees from Syria, will almost certainly continue. They may even intensify for a while, like the thrashings of a dying beast. The huge danger is reviving the beast by boosting its popularity.

Islamic State feeds off Islamophobia. The more it convinces its dwindling band of followers that Muslims are hated and persecuted around the world, so every beheading and bombing is justified payback, the longer they'll sustain some support. The more outrage in the West their followers can stir up with fresh atrocities, the happier the recruiters will be.

Which is why the current political climate is so dangerous.

Voicing hatred of 'the other', whoever that happens to be, is no longer solely the preserve of the extremists of Islamic State but feeds into the rhetoric of mainstream politicians.

The State was a desperately needed opportunity to defuse some of that rage through greater understanding on all sides. But the fleeting glimpse Kosminsky gave us of what was driving his characters and why simply wasn't enough.

Presenting four young Brits as thoughtful, caring humans who are also members of Islamic State — despite charting some of their disillusionment — allows both sides to confirm existing prejudices.

And that just feeds the beast.