Everything MrBigglesworth said, plus:
3. Loss of bicarbonate-poor, chloride-rich extracellular fluid, as observed with thiazide diuretic or loop diuretic therapy or chloride diarrhea, leads to contraction of extracellular fluid volume. Because the original bicarbonate mass is now dissolved in a smaller volume of fluid, an increase in bicarbonate concentration occurs.
4. Loss of chloride-rich fluid leads to enhanced bicarbonate reabsorption. In the late thick ascending limb and early distal tubule, specialized cells called the macula densa are present. These cells have an Na+/K+/2Cl- cotransporter in the apical membrane, which is mainly regulated by chloride ions. When fewer chloride ions reach this transporter, the macula densa signals the juxtaglomerular apparatus to secrete renin > angiotensin II > aldosterone. #1 is enhanced.
5. Furthermore, the kidneys secrete the excess bicarbonate via the apical chloride/bicarbonate exchanger in the B-type intercalated cells of the collecting duct. In this way, protons are gained to the systemic circulation via the basolateral H+ ATPase. In chloride depletion, fewer chloride ions are available to be exchanged with bicarbonate, and the ability of the kidneys to excrete the excess bicarbonate is impaired.