To investigate the inhibitory effect of H2O on the adsorption of CH4/CO2 in coal, the anthracite was selected for physical adsorption experiments on CH4/CO2 gases in this study. Combined with Materials Studio software, the effect of moisture on the isothermal adsorption characteristics of CH4/CO2 in coal was investigated by using density functional theory and giant canonical Monte Carlo simulation. The intermolecular interaction energies were obtained, as well as the effects of electrostatic potentials, adsorption sites, and hydrogen bonding of oxygen-containing functional groups. The results show that: ①According to the CH4/CO2 isothermal adsorption experiments, it was found that moisture significantly inhibited the adsorption of CH4/CO2 by coal. For CH4, the relationship between adsorption constants a/b and moisture content can be expressed by the equations y = 43.447-3.348x and y = 3.225-0.751x. For CO2, adsorption constant a follows a power function relationship with moisture content, expressed as y = 29.114x-0.063, while adsorption constant b is represented by the polynomial fitting equation y = 1.672+0.508x+0.083x2. ② The findings have revealed correlations between the moisture influence coefficient and moisture content. The exponential functional equation η = exp(-0.188ω) was found to be more accurate for coal adsorbing CH4, whereas the linear functional equation η = 1/(1 + 0.243ω) was considered more appropriate for CO2. ③ The van der Waals and electrostatic energies between coal and CH4/CO2 decreased with an increase in moisture content, whereas the van der Waals and electrostatic energies between coal and H2O increased. ④ The orders of hydrogen bond formation ability between CH4/CO2 and functional groups were as follows: –CHO > –COOH > –OH > –CH3 and –OH > –COOH > –CHO > –CH3. The ability of H2O to form hydrogen bonds with –COOH, –OH, –CHO, and –CH3 is as follows: –COOH > –OH > –CHO> –CH3. This study provides a theoretical basis for the integrated use of hydraulic fracturing techniques and coalbed gas injection and replacement.