Ganymede and Europa: Is that confirmed? Last I checked, the 'water' there was simply suspected and was mostly ice. How have they confirmed it is, in fact, H2O?
First of all, ice is
H20, it's not in some chemical class of its own just because it's too cold out there to be liquid. Europa seems to be mainly composed of ice, with a liquid center, similar to how the Earth has a solid crust and a liquid center (generalizing here). Ganymede I am not so familiar with. Mars, though, also has water - a fair bit of it, too, though it's all frozen now. Again, whether the water is frozen or not is irrelevant to the question of how it got onto a planetoid in the first place.
Also, as someone pointed out, even planets with no water can gain water through chemical reactions of hydrogen- and oxygen-containing compounds (usually an acid and an oxide).