Water interactions with polymers play an important role in nearly all aspects of life. Yet, precise understanding and quantification of such interactions at the molecular level is incomplete because many surface sensitive techniques lack the ability to operate under in situ conditions. To fill this gap, we applied tender ambient pressure X-ray photoelectron spectroscopy to study the effect of polymer functional groups, associated interaction types (polar vs ionic), and counterion types on water sorption. Experiments were carried out on model polymer systems of hydrophobic polystyrene, hydrophilic polyvinyl phenol, and charged polystyrene sulfonate thin films. Interaction of water vapor with these polymer surfaces was investigated in situ from ultra-high vacuum up to 100% relative humidity at room temperature. We showed directly at a molecular scale that water sorption is controlled by the polymer's polar and charged groups. Additionally, counterion specific hydration mechanism on polyelectrolytes were revealed. Overall, these results provide mechanistic insights for the design of polymeric materials with improved properties.