This dissociation occur because:
O had to bond with H due to the Hydrogen bonding rule, which will form OH~ (Hydroxide).
K is more attracted to Hydroxide than Cl, so it will depart Cl and bond with OH~.
that leaves a H and a Cl, which one has a positive charge and the other has a negative, so they will bond and form Hydrochloric Acid.