The Fundamental Relation between Halo Mass and Galaxy Group Properties