Dissolved salts exist as separated, hydrated ions, moving and reacting independently. (*)
Like for $\ce{Zn}$ and $\ce{CuSO4}$:
- The reaction is $\ce{Zn(s) + Cu^2+(aq) -> Zn^2+(aq) + Cu(s)}$.
- The ion $\ce{SO4^2-(aq)}$ is called a spectator/bystanding ion in the reaction context, not participating on the reaction.
- The reaction can be formally written using full salt formulas, which should not be confused with molecules, as they express just ion stoichiometric ratios: $\ce{Zn(s) + CuSO4(aq) -> ZnSO4(aq) + Cu(s)}$.
- The driving force is here different ion affinity to electrons and related redox potential and reaction Gibbs energy.
The example for "double displacement" reaction - precipitation of $\ce{AgCl}$ from $\ce{AgNO3}$ and $\ce{KCl}$:
- The reaction is $\ce{Ag+(aq) + Cl-(aq) -> AgCl(s)}$.
- The spectator/bystanding ions are $\ce{NO3-(aq)}$ and $\ce{K+(aq)}$.
- The reaction can be again formally written using full salt formulas: $\ce{AgNO3(aq) + KCl(aq) -> KNO3(aq) + AgCl(s)}$
- The driving force is here the difference in mutual ion affinity for various cation + anion combinations, leading to precipitation of the least soluble salt - $\ce{AgCl}$ in this case.
- It is closely related to energy released by ion hydration versus energy released by ions forming solid ionic lattice, hold by coulombic forces.
- It again depends on the reaction Gibbs energy.
- The same case is when all 4 ion combinations form more or less well soluble salts.
(*) At some conditions, hydrated ions may not move independently, but they can have various degree of mutual connection of their hydration envelope, forming ion pairs.