What makes a compound a dehydrating agent?

When a carboxylic acid with low molecular weight is heated with $\ce{P2O5}$ we get the corresponding anhydride. My book says that this reaction happens with dehydrating agents such as $\ce{P2O5}$. I have also learned from my teacher that $\ce{H2SO4}$ is also a good dehydrating agent.

My question is what makes a molecule a good dehydrating agent? How can I identify one (or maybe what are the common dehydrating agents?) while solving questions?

Also, I have seen the use of $\ce{P4O10}$, but do $\ce{P2O5}$ and $\ce{P4O10}$ play the same role as a reagent?

• Note that $\ce{P2O5}$ and $\ce{P4O10}$ are two ways to reference the identical chemical. The latter is a description of the actual molecule, which contains 4 phosphorous atoms and ten oxygen atoms (see the structure) while the former is a salt-like description only caring for the relative atom count. You should prefer the notation $\ce{P4O10}$ for being a better description of the molecules. – Jan Nov 3 '15 at 18:48
• I think it is not possible to guess which substances are dehydrating agents. You have to learn this from the dehydrating property of the substance. Not all dehydrating reactions can be made with all dehydrating agents. – IV_ Apr 13 '19 at 16:24

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}$$.
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.