The hygroscopic nature of four ionic liquids (ILs) (1-hexyl-4-methylimidazolium chloride ([HMIM][Cl]), 1-octyl-4-methylimidazolium chloride ([OMIM][Cl]), 1-hexyl-4-methylimidazolium bromide ([HMIM][Br]), 1-octyl-4-methylimidazolium bromide ([OMIM][Br])) is known to affect their physicochemical properties, but the effect on the tribological properties is not well understood. To clarify the relationship between the lubricating properties and hygroscopicity of ILs, the water absorption behavior of four ILs was studied. And then, the physicochemical, corrosion, lubricating properties of the ILs were investigated before and after water absorption. Furthermore, the lubricating mechanisms of the ILs after water absorption were explored using density functional theory calculation and surface analysis. The tribological results indicated the Cl-based ILs with low water contents had lower coefficients of friction and larger wear volumes than the pure ILs. This behavior was attributed to the good film-forming ability of the Cl-based ILs with low water contents as well as the generation of HCl. In contrast, the Cl-based ILs with high water contents and the Br-based ILs after water absorption exhibited worse tribological performance, owing to their poor film-forming abilities on steel surfaces. The findings of this study could enhance the understanding of the relationship between hygroscopicity and tribological properties for ionic liquids. It will provide important theoretical basis and technical guidance for the development and application of ionic liquids as lubricant and lubricating additives.