It depends on which molecules you are talking about, but yes it has to do with polarity. Protonation of some molecules causes the molecule to have a + charge allowing the polar solvent, H2O, to dissolve it. (Like dissolves like). Deprotination can also have the same effect