For Saudi Arabia, fighting the self-proclaimed Islamic State presents a double-edged sword. Not only does the kingdom face threats from terrorists on its soil, but IS poses a threat to the very core of the kingdom's beliefs system, as it has roots in a version of Islam — Wahhabism — that is taught in many Saudi schools and mosques.

On July 18, the Kingdom of Saudi Arabia (KSA) launched a wide-reaching domestic security operation that resulted in the arrests of 431 individuals accused of having links to the IS. Among the charges were plans to attack mosques, and security and government buildings, along with an unnamed diplomatic mission.

This arrest operation now joins a growing list of security incidents with links to IS, and includes the disruption of a plot to target the US embassy with a car bomb in March, the killing of police officers in April, and the suicide bombing of two Shia mosques in May.

While these incidents continue to highlight the operational reach of IS, they also underscore a more fundamental challenge for the government of Saudi Arabia: how to simultaneously fight IS abroad and at home.

Both remain daunting tasks given the number of active Saudi foreign fighters in Iraq and Syria, which according to an estimate released by the International Center for the Study of Radicalization and Political Violence (ICSR) is now between 1,500 and 2,500 individuals — making Saudis the second largest group of foreign fighters on the ground with IS, after Tunisians.

Some of these fighters will inevitably return to Saudi Arabia, looking to establish domestic terrorist cells by spreading the message of IS in mosques and on the internet. This remains a core strategy of IS leader Abu Bakr al Baghdadi, who refers to Saudi Arabia as Wilayat al Haramayn, or Province of the Two Holy Places, a reference to the Islamic holy sites of Mecca and Medina.

"Saudi Arabia has religious significance for al Baghdadi's pretensions to rule over the Islamic caliphate," Philip Stack, principal analyst for the Middle East and North Africa at Verisk Maplecroft, a global risk analytics firm, told VICE News. "[He] claimed jurisdiction over what he termed Wilayat al Haramayn in November 2014, [asserting] his direction over jihadists in Saudi Arabia."

This would not be the first time Saudi Arabia has had to combat a domestic jihadist uprising. In 1979, militants seized the Grand Mosque of Mecca, calling for the overthrow of the Saudi government. More recently, and coinciding with the invasion of Iraq by US forces in 2003, al Qaeda launched a violent three-year insurrection that targeted security forces, Westerners, and government officials.

Saudi Arabia's security services were eventually able to defeat the al Qaeda-led insurgency through a mixture of innovative counter-terrorism operations, such as printing the names of al Qaeda operatives in the press, and trying to rehabilitate jihadists through extensive religious re-education.

Watch the VICE News Documentary: Escape to the Islamic State

But IS isn't al Qaeda, and the number of Saudis now involved with IS and the resources available to them — in terms of both financing and personal appeal — has exceeded anything that was ever available to al Qaeda. The presence of IS across the border in Iraq, and to a lesser degree in Yemen, is also posing a unique challenge in containing the spread of extremism within Saudi Arabia.

And even though the objective of overthrowing the Saudi government has remained the same, the strategies being used by IS are evolving. They are now focused on the same kinds of sectarian attacks being used in Iraq, Syria, and Yemen — such as the targeting of Shia mosques.

"In Saudi, IS is most certainly in the beginning of the first stage: spite and burnout," Ghaidaa Hetou, of i-Strategic, a political risk consulting firm, told VICE News, referring to one of the two stages of IS's operational doctrine. "In this stage, one particular incident of [terror] will not capture a specific aim, but the aggregate of several incidents … will gradually, in their view, lead to a collapse of the system."

By engaging in these kinds of sectarian attacks, IS conforms to a well-known approach, one that will attempt to drive a wedge between the people they are attacking and the government that is supposed to protect them. By doing so, IS hopes to promote instability within Saudi Arabia by making the government appear weak and ineffectual.

And given the scope of the arrest operation on July 18, there is clearly a widening apprehension over IS penetration within Saudi Arabia.

"The support for IS is rising in [Saudi Arabia]," Hetou said.

This support originates from more than just social and political conditions, however, and is far more troublesome for long-term stability. Core tenets of the IS belief system, which include a hatred of Shia and executions for apostasy and adultery, all originate with Wahhabi religious teachings that have legitimized the Saudi government. More specifically, IS has taken the idea that apostates and heretics should be killed and combined that with the notion that just about any devout Muslim can deem someone else insufficiently pure or Islamic, and therefore apostate, and therefore subject to on-the-spot execution.

For people who have received their religious indoctrination in these Saudi schools and mosques, the next step into the extreme doctrines embraced by IS is not a huge one.

This has put the Saudi government in a precarious position.

"You look at the core tenets of Wahhabism and you look at the core tenets that have been espoused by IS and they are exactly the same," Akhil Shah, a counterterrorism and foreign policy analyst at the Institute for Gulf Affairs, told VICE News. "Groups like the Islamic State give young Saudis an identity. It takes place within the same ecosystem, ideology, and religious outlook."

Therefore, to fully undermine the ideological basis of IS, the Saudi religious establishment would have to subvert the doctrines that are nearly identical to those that support their own authority. Thus, theologically undermining IS risks undermining the legitimacy of the entire Saudi government.

This has left the Saudis with only a few options, such as reconciling with the minority Shia population or limiting the influence of religious ideologies that might resemble those of IS. Both of these choices inevitably support the narrative of IS, who claim that the Saudi government is not only corrupt, but also religiously compromised.

"They [IS] are revisionists with a clear political aim,"Hetou said. "They are motivated to 'correct the humiliating past … on the hands of the infidels and their puppets.' The Saudi authority is regarded as an American puppet."

For some in Saudi Arabia, this is all the incentive needed to seek out and support IS.

The circumstances required for IS to thrive in Saudi Arabia are currently sub-optimal. IS tends to mature in ungoverned spaces and failed states like Syria, Iraq, and Yemen, and the Saudi government is far from collapse. Nevertheless, for IS's vision of the caliphate to become fully realized, IS must be seen struggling for control of the spiritual capital of Islam, or the Wilayat al Haramayn. This means the terrorism and insurgency that is currently plaguing the Middle East is far from over in Saudi Arabia.