Why does gastritis cause potassium loss?

Vomiting. If vomiting is involved it has to do with the renal handling of acid base. In order to normalize acid base balance, the kidney allows sodium bicarbonate to pass through it to the distal tubule. There, the sodium is exchanged for potassium which is lost in the urine.