The question should be more specific since there could be more than one function, depending on it's intended use. For example, you could use it just to make a calcium chloride solution for various reasons. But my guess is the purpose here is as a dessicant (drying agent). It is very hygroscopic (sucks up water like nuts) so it can be used in an enclosed environment to help keep the moisture in that environment to a minimum. You can also pass a gas (or even certain organic solvents) through calcium chloride in order to dry that gas or solvent.