If all molecules are exactly the same than why only some of the ions gets dissociation in some weak acids and bases
The bouncing around of molecules in solution causes some to break apart by random chance, and others to come back together. The result is a balance of broken and not-broken ones, which shifts more toward the broken side as the molecule becomes less stable.
Individual molecules are constantly splitting and reforming.
This is a state we call “equilibrium” in chemistry.
At any given moment some percentage of the ions are dissociated, but any individual ion will bind and break away from its counterpart repeatedly.
All of the molecules will do this, they are more or less interchangeable and their ions get shuffled around during recombination events.