initially after independence, pakistani army kept its distance from reactionary mullahs. army leadership resisted mullah demand for declaring ahmedis non-muslims and ayub introduced family law ordinance which gave far reaching and unprecedented rights to pakistani women. needless to say the ordinance was heavily opposed by mullahs.
come 1979 however and the relationship between army and the hardline mullahs began to change. reason: the russian invasion of afghanistan which happened 9 years after the separation of east pak. russia had been a traditional enemy of muslims and had conquered nearly all the muslim countries in central asia. pakistani leadership viewed russian involvement in afghanistan as attempt by russia to further extend its influence. its logical to assume that after doing the needful in afghanistan, russia would turn its sight on pak. for logistical reasons, warm water pakistani port would be a goldmine for russians. plus russians would want to reward their aghani allies who had coveted pukhtun areas of pak since the creation of pak. also indians who were a strong ally of russians would demand their pound of flesh from russians. russians also actively supported separtist elements in pak which made the russian presence in afghanistan more alarming.
given the circumstances in 1979, i think army had little choice but to oppose russian invasion. religious pakhtun leadership on both sides of durand line wanted to fight the russians and put pressure on pak to provide assistance. pak acquiesced and out of the relationship emerged the jehadi leadership whose existence has done huge damage to pak society.
as the lal masjid incident very clearly indicates, pak army has to deal with the monster it helped to create. it aint gonna be pretty but the task must be completed if pak has to progress. realpolitik required army to deal with jehadis in the past. realpolitik now requires elimination of jehadis.