Original: It is a by-product of the making of nitric acid from potassium nitrate and hydrochloric acid.
Simplified: It is made when potassium nitrate is reacted with hydrochloric acid, making nitric acid and potassium chloride.