HCl is polar covalent in nature, i.e., shows charge distribution in its molecules such that the hydrogen atom has a slight positive charge and the chlorine atom has a slight negative charge.
Hδ+ — Clδ-
When hydrogen chloride is added to water [a polar covalent solvent], the slightly negative charged oxygen atom of water exerts an electrostatic pull on the slightly positively charged hydrogen ions present in the molecule of HCl.

Thus, H+ ions combine with water to form hydronium ions [H3O]+.
The presence of hydronium and chloride ions makes hydrochloric acid a good conductor of electricity.