Noncovalent interactions behind the direct and inverse Hofmeister effects