Under Indus Water treaty Pakistan has exclusive right to the water of 3 western rivers (Jehlum, Chenab, Indus) for irrigation, but India can construct run of the mill power projects on these rivers.
India had to notify Pakistan about construction of any structure on these 3 rivers. In which case two countries through their Indus Water Commissions will try to resolve any issues with design of structure. In case they are not able to resolve the issue between themselves, issue can be referred to ICJ which is a binding on both countries.
This has been the case with Baglihar & NJ Project, where ICJ made the decision.
For example the issue in case NJ project was not that India can stop water of Pakistan. Issue was that with KG project India could have diverted water from Neelum river to Jehlum river for production of electricity. This would have meant that while water would still have been available to Pakistan for irrigation, but NJ which is a purely Hydro Electric Proj would not be as effective since it also relies on water in Neelum. ICJ ruling was considered favorable by Pakistan.
Similarly another issue of recent history has been Baglihar Dam. Again ICJ was involved but in this case ruling wasn't considered favorable by Pakistan, although India was asked by ICJ to make some changes to design.
Now this should give you idea of how Treaty works. But just to give you idea of storage capacity:
Storage Capacity of Baglihar Dam: 0.012MAF
Storage Capacity of Tarbela Dam: 6.8 MAF
The perception that somehow India is cause of all water problems of Pakistan is not entirely true. Why?
Tarbela & Mangla's capacity over time has reduced. Tarbela when completed in 1976 had capacity of 9.7 MAF. Over 35 years due to siltation this has reduced to 6.8. That a reduction of 3MAF of water storage. Thats 300 Baglihar Dams. Same is the case with Mangla although Mangla Dam raising project has revived some of the lost capacity. Add to it increase in population and water consumption.
So Pakistan needs to construct a Major Dam and quick. KB is ideal because it can be constructed quickly & easily and at less cost compared to DB dam. But as KB is controversial, we need to stop focusing on KB for god-sake and start focusing on DB dam. DB while difficult & expensive, had advantage that since its upstream from Tarbela. It slow down siltation at tarbela and increase its effective life by 35 years. Also adding 6.4 MAF of storage to Pakistan's irrigation system.