Hydrated salts are salts that contain molecules of water or waters of hydration. Most of the salts in the lab exists in the hydrated form. The primary purpose of the formula in the hydrated lab experiment is stoichiometrically. The hydrated salt has the salt part and the water part and upon some experimentation, the water part will be removed and the salt part will be weighed. The ratio of which will determine how many waters of hydration exists.
For example: A 25 grams of CuSO4-xH2O is heated and 16 grams remain. To get the amount of water, we just subtract 16 from 25 hence having 9 grams of water. Now by stoichiometry, we can solve the number of hydration indicated by letter 'x' in the formula.