Currently under military pressure in Iraq and Syria, and still terrorising civilians far beyond those lands, ISIL has horrified and bewildered Muslims and non-Muslims alike.

Its carefully studied barbarism and cinematic savagery seem to owe as much to Hollywood action movies and computer combat games as to interpretations of classical Islamic jurisprudence; the furiously destructive passions of its adherents appearing insane.

ISIL is certainly immoral, but its actions are rooted in specific political contexts and based on a greatly contested analysis of ancient and contemporary Islamic texts.

Shiraz Maher’s magisterial Salafi-Jihadism: The History of an Idea provides an “explanatory backstory” to this and other manifestations of what could be called in shorthand the Al Qaeda tradition.

British-Pakistani scholar Maher, a fellow at the International Centre for the Study of Radicalisation, Kings College London, researches the topic from an academic perspective. In his student years, as a member of the now-banned extremist organisation Hizb ut-Tahrir, he experienced it from within.

Salafists preach “progression through regression”, specifically a return to the practice of the first three generations of Muslims known as the Salaf Al Salih, or the “righteous predecessors”.

Although its antecedents go back at least to the medieval theologian Ibn Taymiyya, Salafism is a modern phenomenon – a response to modernity – developed in the past 150 years. There are “quietist” and “activist” strains, but Maher’s book focuses on the “violent-rejectionists” who have risen to prominence even more recently. Their ascent since the early 1990s coincided with a decline in those varieties of political Islam that hoped to achieve power through reformist or democratic means.

Maher quotes Trotsky’s dictum that “war is the locomotive of history”. The war sparked by the suspension of Algerian democracy, the anti-Soviet war in Afghanistan, the wars in Iraq, and today’s conflict in Syria, constitute stations in the development of Salafi-Jihadism, a movement which is at once revolutionary and deeply reactionary.

Maher defines Salafi-Jihadism in terms of its particular interpretations of five key concepts: jihad, takfir, al-wala’ wa-l-bara’, tawhid and hakimiyya.

To take the last first, modern interest in hakimiyya, or “the securing of political sovereignty for God”, was provoked by negative experiences of colonial conquest and forced industrialisation. Several important Muslim thinkers in British India, including Abul A’la Maududi and the poet Muhammad Iqbal, urged Islamic cultural renaissance alongside social justice.

After political independence, “activist” Salafists in the Arab world prioritised “advising” governments instead of rebellion against them. While insisting on the supremacy of Islamic law, they called for consultative councils to guide the rulers in interpreting the law.

Violent-rejectionists, on the other hand, consider democracy in any form to be a “man-made deity” usurping God’s powers. They hold that all Muslim states have failed to secure divine rule, and must therefore be fought.

Of course, tawhid, or the oneness of God, is central to any Muslim’s world view. Once again, however, Salafi-Jihadists have given their own take on the concept. Tawhid implies unity of worship, “something that requires manifestation through practical agency”.

It is therefore easily associated with jihad, specifically through the mujahid’s absolute conviction that he cannot die until the moment predestined by God. Next comes al-wala’ wa-l-bara’, an ambiguous term translated as “loyalty and disavowal”, which reinforces the boundaries between “us” and the non-Muslim “them”. For political Islamists as well as the Salafi-Jihadist fringe, this concept means that the worldwide Islamic community, the umma, is “the sole basis of citizenship, identification, loyalty and allegiance”.

It was used as a tool for popular mobilisation against external challenges during the first Saudi kingdoms, then framed the debates over the permissibility of hosting American military bases, specifically of seeking western aid to expel Saddam Hussein from Kuwait. Finally Salafi-Jihadists employed it to mobilise against all established power structures on the basis of their supposed unbelief.

Which brings us to takfir, “the process of declaring another Muslim, or a group of Muslims, to be outside the fold of Islam”.

The first takfiris were the khawarij, a group who pronounced takfir on Ali, the fourth Caliph and the Prophet’s nephew, when he agreed to arbitrate a dispute in the early Islamic community rather than allow God to choose the victor through battle. Khawarij means “those who left” the Muslim consensus and turned to extremism, and Muslims today often apply the title to ISIL.

In his seminal text Milestones Along the Way, written during his imprisonment in the 1950s, Egyptian Islamist Sayyid Qutb argued that Muslim societies had regressed to a state of jahiliyya, or pre-Islamic ignorance. Following this lead, Khalid Islambouli declared, “I have killed Pharaoh” after assassinating president Anwar Sadat in 1981.

During the insurgency against the American occupation of Iraq, Salafist-Jihadists expanded the range of those they declared unbelievers to include not only heads of state but enormous sections of civilian society. Nationalists, communists and democrats were all fair game. Soon the Shia were added to the list.

The practice of takfir aims to homogenize the faith by shutting down debate and dissent. It also tends to de-contextualise and de-historicise political conflict. Many Iraqi Shia leaders chose to work with the American occupation. Rather than understanding this “treachery” as a reaction to Saddam Hussein’s oppression of the Shia community and a pragmatic approach to establishing communal power, Salafi-Jihadist propaganda referred to Shia Muslims as Zoroastrians, Mongol agents, and Safavids – in other words as eternal, unchanging opponents of Sunni Muslims. This sectarian enmity, of course, did not serve Sunni interests. It was one reason why the insurgency degenerated from a national liberation struggle into civil war, and its continuation today boosts the narrative of those convincing gullible Shia to fight on Bashar Al Assad’s front lines in Syria.

The best-known concept of the five discussed by Maher is jihad. The Sufi tradition considers the believer’s struggle with the self as the “greater” jihad, but the warlike meaning has larger, and ancient, resonance. The Prophet himself participated in 27 battles, and Ibn Taymiyya held that “the first obligation after iman [faith] is the repulsion of the enemy aggressor”.

Traditional Islamic warfare, in theory at least, was prosecuted within an ethical framework. The first caliph, Abu Bakr Al Siddiq, set out rules including the following: “You must not mutilate dead bodies. Neither kill a child, nor a woman, nor an aged man. Bring no harm to the trees, nor burn them with fire ... Slay not any of the enemy’s flock.”

A distinction was also made between defensive and offensive jihad. The latter could only be sanctioned by an Islamic ruler.

How do we arrive from this origin to today’s indiscriminate “lone wolf” attacks against western civilians?

Maher explains the interpretive gymnastics which transferred the eye-for-an-eye law of qisas, or equal retaliation, to the field of international relations. The West is blamed for keeping tyrannous or insufficiently Islamic regimes in power in Muslim countries. Citizens of western democracies, because they are governed by consent, are then considered liable for their governments’ actions. This is what scholar Nibras Kazimi called “the triumph of battlefield logic over theology”.

At some points, Salafi-Jihadist justifications for terror abandon theology altogether. Al Qaeda leader Ayman Al Zawahiri and others argue that the Islamic rules concerning tartarus, or human shields, are outdated because modern weaponry does not distinguish between civilians and combatants.

Jihadists, moreover, as non-state actors, are compelled to prosecute asymmetrical warfare through terrorism. By this faulty logic the large-scale slaughter even of Sunni Muslim civilians is justified.

Surely such free and easy treatment of classical jurisprudence is an example of the bida’, or innovation, which is supposedly anathema to Salafis? Salafi-Jihadists such as Abu Bashir Al Tartusi have contested Zawahiri’s nihilism. Maher points out that these faultlines in the movement are most apparent between theorists and “those who are operationally active in the field”.

The self-interested legalistic sophistry of these organisations eliminates the role of the conscience, surely God’s first gift to mankind. Like the dictators they claim to oppose but often end up serving, Salafi-Jihadists seek to enforce obedience through terror. The fear they promote has debilitating effects on society, crushing thought and blocking new directions.

The size of the problem adds to the importance of Maher’s book. Essential reading for policymakers, Salafi-Jihadism is an academic work of intellectual history well enough written to interest the general reader too.

Robin Yassin-Kassab is a critic, novelist and the co-author of Burning Country: Syrians in Revolution and War.