If the French mayors leading the blitz against the burkini were to read Tabish Khair’s Jihadi Jane, would they feel vindicated? The novel is the story of the radicalisation of two young women in Britain, barely out of their teens, and their journey to join the Islamic State in Syria.

Still, the answer to the question, one would venture, is no. The hallmark of good fiction, as opposed to polemic or propaganda, is that it complicates. It is a light flashed through the fog but what you see is a swathe of grey. Fiction is no friend of the evangelist, whether his creed is extremist laïcité or Islam.

Ameena and Jamilla are unlikely friends in a British school. Jamilla is the orthodox, sombre Muslim girl, whose brother and father have always complained bitterly about living in a country alien to their faith. Ameena is the rebel, raised by a divorced mother, ready to knock down rules, whether it is about dating or smoking. Hers is the starkest trajectory, from sceptic to internet-fuelled religious fanatic. But it is also not entirely surprising: anyone who has seen/been a certain type of strong-willed teenager would recognise Ameena’s need for an ideal higher than the dross of daily life.

Jamilla and Ameena’s experience in school add up to a tragi-comedy of good intentions and missed connections. A particularly fine bit is about the English teacher Mrs Chatterji’s efforts to draw in Jamilla into a discussion about a Wendy Cope poem on infidelity. Even as she recognises the wit and skill of the vilanelle, Jamilla reacts with a diatribe against the vices of the West. She is lashing out with anger, which “seemed to come from beyond me, which left me feeling angrier still”. (Jamilla remembers Mrs Chatterji in Syria later, a period of abject disillusionment, when Daesh orders a purge of books at the hostel-seminary she is housed in.)

As Khair seems to suggest, the girls’ enchantment with extremist Islam arises from a complex mix of social disaffection and personal failings. Secular societies are deaf to the peculiar alienation of the religious, especially women who seem immune to your and mine idea of freedom. “The way an orthodox woman wants to dress, interact..live is under constant assault by ordinary life in the West…You opt out of the glitter of the West because of your belief. It takes strength to do so. More strength than Muslim men realize…But you are told by every stupid politician or journalist that you are an automaton, that you are brainwashed or daft,” writes Jamilla. But Khair also never lets you lose sight of the fact that these are teenagers, after all, caught in the fug of intense emotions and bravura, bewildered by the choices they have made.

Like Mohsin Hamid’s The Reluctant Fundamentalist, the novel is Jamilla’s monologue, as he explains herself to a fictitious author, who declared that people like her, democracy’s apostates, should not be allowed back into “civilisation”. But while the irony of Hamid’s novel was directed at Western assumptions, Jihadi Jane is also a look inward.

One way Khair does that is to chart the generational differences in the way religion is conceived. Jamilla’s mother is a devout, if submissive Muslim. The religion she practised back home was different from its version in a foreign land, shorn of rituals and customs. It is held to be superior than “illiterate local traditions” by her son, whose male authority she submits to. As Jamilla proceeds deeper and deeper into the innards of the Islamic State, the Islam she embraces becomes more attenuated of human colour, more a hectoring than a consolation. In search of purity, she finds only “meagreness”. In search of freedom from an arranged marriage, she realises she has no more liberty than her Ammi.

The novel falters on several counts: the cardboard villains of the ISIS, for one; and the way the narrative abandons Ameena and her story, more importantly, her distinctive, angry voice. But Khair’s novel is an instructive read on the limits of liberal and secular values, as well as a warning against the rigidities of Islam. “[Do] you know when a good fight becomes evil? Evil, I am certain now, arises whenever a person believes that only what he considers purely good has the right to exist…”