We have investigated the gas content of a sample of several hundred AGN host galaxies at z$<$1 and compared it with a sample of inactive galaxies, matched in bins of stellar mass and redshift. Gas masses have been inferred from the dust masses, obtained by stacked Herschel far-IR and sub-mm data in the GOODS and COSMOS fields, under reasonable assumptions and metallicity scaling relations for the dust-to-gas ratio. We find that AGNs are on average hosted in galaxies much more gas rich than inactive galaxies. In the vast majority of stellar mass bins, the average gas content of AGN hosts is higher than in inactive galaxies. The difference is up to a factor of ten higher in low stellar mass galaxies, with a significance of 6.5$sigma$. In almost half of the AGN sample the gas content is three times higher than in the control sample of inactive galaxies. Our result strongly suggests that the probability of having an AGN activated is simply driven by the amount of gas in the host galaxy; this can be explained in simple terms of statistical probability of having a gas cloud falling into the gravitational potential of the black hole. The increased probability of an AGN being hosted by a star-forming galaxy, identified by previous works, may be a consequence of the relationship between gas content and AGN activity, found in this paper, combined with the Schmidt-Kennicutt law for star formation.