Strictly speaking, It's not alkalosis that causes hypokalemia. It's the reverse, hypokalemia causes alkalosis. However, let's discuss the two directions below:
How does Hypokalemia causes Metabolic Alkalosis?
Hypokalemia causes potassium to move from cells into the extracellular fluid, and this transcellular potassium flux is accompanied by movement of hydrogen ions from the extracellular fluid into cells to maintain electroneutrality. The movement of hydrogen into the cells increases the plasma bicarbonate concentration and simultaneously lowers the intracellular pH. The ensuing intracellular acidosis in renal tubular cells promotes hydrogen secretion and therefore bicarbonate reabsorption.
How does Metabolic Alkalosis causes Hypokalemia?
Alkalosis per se does not cause hypokalemia. However, hypokalemia can co-exist with alkalosis because they have the same causation. The major causes of metabolic alkalosis (vomiting, diuretics, mineralocorticoid excess) directly induce renal potassium loss.