Dehydration of biomass-derived polyalcohols has recently drawn attention in green chemistry as a prototype of selective reactions controllable in hot water or hot carbonated water, without any use of organic solvents or metal catalysts. Here we report a free energy analysis based on first-principles metadynamics and blue-moon ensemble simulations to understand the mechanism of competing intramolecular dehydration reactions of 1,2,5-pentanetriol (PTO) in hot acidic water. The simulations consistently predict that the most dominant mechanism is the proton-assisted S N 2 process where the protonation of the hydroxyl group by water and the CO bond breaking and formation occurs in a single step. However the free energy barriers are different between the reaction paths: those leading to five membered ether products, tetrahydrofurfuryl alcohol (THFA), are few kcal/mol lower than those leading to six membered ether products, 3-hydroxytetrahydropyran (3-HTHP). A slight difference is seen in the timing of the protonation of the hydroxyl group of THFA and 3-HTHP on their reaction pathways. The detailed mechanism found from the simulations shows how the reaction paths are selective in hot water and why the reaction rates are accelerated in acidic environments, thus giving a clear explanation of experimental findings for a broad class of competing dehydration processes of polyalcohols.