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?
When dealing with the integers, our subgroup $H$ is the group $n\mathbb{Z}$ and must recall that the operation on the integers in this case is additive, so $b^{-1}$ is actually $-b$. Thus, if $a \equiv b\pmod{n}$, then $a-b \in n\mathbb{Z}$, so $a - b$ is a multiple of $n$.