Hydrochloric acid is prepared by dissolving hydrogen chloride in water. Hydrogen chloride can be generated in many ways, and thus several precursors to hydrochloric acid exist. The large-scale production of hydrochloric acid is almost always integrated with the industrial scale production of other chemicals.
Hydrochloric acid is also used in the production of batteries, photoflash bulbs and fireworks. It's even used to process sugar and make gelatin. Hydrochloric acid, like last month's chlorine compound, sodium chloride, is another "workhorse" chemical because it is incredibly useful in a wide variety of ways.