To achieve the high [NH3] in the medullary interstitium, NH4+ is actively reabsorbed via the Na+, K+, 2Cl- cotransporter, NH4+ replacing K+.
This explains the association between hyperkalaemia and RTA, as when the [K+] is high this inhibits this process due to competition between K+ and NH4+ for the cotransporter.