I.N. Herstein has defined:
Let $G$ be a group, $H$ a subgroup of $G$; for $a,b \in G$ we say $a$ is congruent to $b \mod H$, written as $a \equiv b \mod H$ if $ab^{-1} \in H$.
Let $G$ be a group, $H$ a subgroup of $G$; for $a,b \in G$ we say $a$ is congruent to $b \mod H$, written as $a \equiv b \mod H$ if $ab^{-1} \in H$.
When dealing with integers $a \equiv b \mod n$ means $n \mid (a-b)$, what is the meaning of $a \equiv b \mod H$ in context of group theory? And why and how has $ab^{-1} \in H$ been used as a condition to define this relation?