Correction to the correction: There is no mention of "internal" threats or "nazriyaati hudood" in the Constitution. It is a devious construct perpetrated to mislead and usurp power.
https://pakistanconstitutionlaw.com/article-245-functions-of-armed-forces/
Article: 245 Functions of Armed Forces
245. Functions of Armed Forces.- 1[(1)]
The Armed Forces shall, under the directions of the Federal Government, defend Pakistan against external aggression or threat of war, and, subject to law, act in aid of civil power when called upon to do so.
(2) The validity of any direction issued by the Federal Government under clause (1), shall not be called in question in any Court.
(3) A High Court shall not exercise any jurisdiction under Article 199 in relation to any area in which the Armed Forced of Pakistan are, for the time being, acting in aid of civil power in pursuance of Article 245:
Provided that this clause shall not be deemed to affect the jurisdiction of the High Court in respect of any proceeding pending immediately before the day on which the Armed Forces start acting in aid of civil power.
(4) Any proceeding in relation to an area referred to in clause (3) instituted on or after the day the Armed Forces start acting in aid of civil power and pending in any High Court shall remain suspended for the period during which the Armed