You're right but that's just one factor - albeit an important one for currency depreciation. There are many others too (level of interest rates, economic activity, debt ,aid, FDI, remittances etc). Also, in case of Pakistan, there is one very important factor for the demand of $ - the expectation/perception/low level of trust in PKR due to which people demand dollars as they see it as an investment, rather than just a currency. It is the same reason, Gold and Bitcoins are so valuable regardless of their intrinsic value. Conversion to USD also acts as a hedge against inflation as most of our expenses are linked to $ rate.
Right now, PKR is depreciating due to higher demand of $ from investors in both Pakistan and Afghanistan as people in both countries are fearful that their local currencies will go down further which will erode their hard earned wealth. So perception is also an important factor and it is Govt job to manage that perception that their currency is stable. Otherwise currencies can even lose half their values overnight in case of sudden jump in $ demand if the perception moves towards hopelessness. We have seen countless examples of currencies around the world that become worthless once that run on currency conversion to dollars kicks in.
Govt, through sensible policy making, can control all these variables. However, when SBP governor is non-serious about sending a signal to market that they are protecting the currency, then people see it as a bottom less pit and start accumulating dollars that keeps on eroding the FX rate.