Massive military campaigns against the Mujahideen, who blended in with the local population, caused extensive destruction of local infrastructure and death, which made the local population to side with the Mujahideen.
