Most of their food has to be prepared a special way to ensure that it can be eaten in microgravity and that it will not spoil. The most common method of preparing food for space is dehydration. Rehydratable foods have been dehydrated by freeze drying, air drying, or other methods. Dehydrated ice-cream does not have to be kept in the freezer and it feels like Styrofoam. The astronauts rehydrate the food by just putting it in their mouth or rehydrating it with water.
Water is produced by the fuel cells which generate electricity from hydrogen and oxygen.
Water is a by-product.