State-of-the-art ion-selective membranes with ultrahigh precision are of significance for water desalination and energy conservation, but their development is limited by the lack of understanding of the mechanisms of ion transport at the subnanometer scale. Herein, we investigate transport of three typical anions (F−, Cl−, and Br−) under confinement using in situ liquid time-of-flight secondary ion mass spectrometry in combination with transition-state theory. The operando analysis reveals that dehydration and related ion-pore interactions govern anion-selective transport. For strongly hydrated ions [(H2O)nF−and (H2O)nCl−], dehydration enhances ion effective charge and thus the electrostatic interactions with membrane, observed as an increase in decomposed energy from electrostatics, leading to more hindered transport. Contrarily, weakly hydrated ions [(H2O)nBr−] have greater permeability as they allow an intact hydration structure during transport due to their smaller size and the most right-skewed hydration distribution. Our work demonstrates that precisely regulating ion dehydration to maximize the difference in ion-pore interactions could enable the development of ideal ion-selective membranes.