Some are not going to like what I am about to write, but I have recently had a conversation with someone who has had first hand experience with terrorism in Xinjiang in the late 80s and early 90s.
This was the time when word of ethnic tensions first started to go mainstream, although there was always a lot of racial tensions since they very start, it was never well organised or that coherent. With some villages welcoming the Han with open arms while others would lynch people who marrying Han Chinese.
But the general trend in the late 80s and early 90s was fairly peaceful.
At the time, China was engaging in a lot of infrastructure construction projects, mainly in the oil and gas sector. Xinjiang is a very sparsely populated and underdeveloped part of China, more so back then.
Then, out of the blue, they started to experience a wave of attacks by people in jeeps and other off-road vehicles or even horseback who would drive/ride up to a section of pipeline and blow it up or set it on fire. Often within view of Chinese oil and construction workers, who just couldn't get there in time, and didn't really have the means to do anything even if the could get on scene.
The Frontier Corps were deployed as security, and given permission to open fire if anyone tried to attack the pipelines.
At the same time, police, PAP and other agencies co-ordinated to track down any attackers who fled.
Eventually, this led to the discovery that the overwhelming majority of the attackers were not real believers or terrorists (often they didn't even know what they were attacking), but dirt poor farmers and herders, who lived in abject poverty, often in appalling conditions.
So when strangers with foreign accents offered them hard currency which amounted to several years' worth of their annual household income (which amounted to a pitifully low dollar amount), they were pretty much ready to sell their souls.
They were given weapons and explosives, sometimes vehicles and drivers as well, and told to blow up the pipelines.
When the Frontier Corps started using lethal force to protect the pipelines, they weren't killing true terrorists, just really poor and desperate people who were employed by foreign agencies.
This helped created the real true believers and terrorists, as they watched their fathers and uncles and brothers get gunned down and/or hunted down by Chinese police.
I think China did make some mistakes by using the unreliable (and often trigger happy) Frontier Corps rather than police or even army, and fast tracking cases through the courts, giving the impression that the criminal justice system was a tool of oppression rather than justice (it didn't help that most locals didn't understand what the pipelines were or the damage the bombings and attacks were causing.
However, the root of the racial tensions could be traced to the men with foreign accents who effectively send the locals on suicide missions.
In hindsight, it should be pretty obvious that their main aim and goal wasn't to try and disrupt the flow of oil and gas, but rather to create martyrs and turn the local population against Beijing and the Han.
A few people with suitcases full of cash, small amounts of explosives and weapons effectively manufactured the racial tensions and violence in Xinjiang, and they have never let up.