paki got weapons because usa and china kept them arming against india,
china and usa kept paki military well armed,
otherwise paki are begger nation and they got all the weapons either by begging or by exploiting americans needs or by extorting them.
Does not matter as long as they so have those weapons and possibility of getting more during a conflict.
However,
@Sylex21 has not considered
Iranian people and Pakistani people, and their commitment to the nation, which is vastly different evidenced by the history. Iran has already fought and own victory in a life and death war with Iraq despite having a vast technological set back, and they internally have more unity than Pakistan. The whole of FATA is only nominally under Pakistan and Baloch people, who are culturally more closure to Iranians hates the Pakistan.
Also, any war between Iran and Pakistan when will be supported by the Sunni world, they acrually are too much fragmented ro add some significant value to it. The Arabs are hardly like to dirty their own hands for the sake of Pakis.
Further, Russia most likely would pitch in ar least with tech and weapons support, and if there is a pragmatic PM in India, Oakis will be at least having a partial blockade by IN too.
Also, when Pakis have superior military at least by numbers, they hardly have any experience but of defeat in their whole history. Even the terrorists have been kicking their asses for most of the last decade and even after bombing out whole villages they have not managed to achieve any success. So would not call the Oaki army to be superior. Where as the Iranians have been kicking ass of ISIS successfully more or less in the last last year.
IMHO in any war human factor is more important that how much ir how fantastic the weapons you have. Just see, how even after a decade and trillions of dollars wasted, USA still lost the war in Afghanistan and Iraq, and in verge of losing the whole ME in coming decade, if ISIS menace is not curved.