What makes a compound a dehydrating agent?
To answer your question, what makes a compound a dehydrating agent is, in my opinion, stability, a good affinity for water and possibly inertness (or in special cases, selective activity but in reforming a designated salt, see example below).

Now, $\ce{P2O5}$ is a white powder that loves water, in fact, it reacts violently and exothermically with water forming $\ce{H3PO4}$.  Phosphorus pentoxide is the anhydride of orthophosphoric acid, $\ce{H3PO4}$ , as dehydration of the latter yields $\ce{P2O5}$. 

A safe, effective and inexpensive dehydrating agent is dry Calcium chloride. Again a strong affinity for water and a stable salt.

Per one preparation, one can dehydrate aluminum chloride hydrate by gentle heating in a stream of DRY hydrogen chloride gas (which is the gaseous anhydride of Hydrochloric acid), see here. Just heating the hydrate in air can result in basic aluminum chloride formation, but, I suspect, the dry hydrogen chloride gas can convert any created basic salt back to just $\ce{AlCl3}$ and water (removed by heating and contact with the dry gas). Note, gaseous $\ce{HCl}$ is inert with respect to chloride and stable.