For example magnesium chloride holds water within its crystal lattice and if you dry it that water comes out, but as it comes out it also strips out  the chlorine as hydrogen chloride gas for example.