There is a theorem In Terence Tao's Additive Combinatorics:
Proposition 2.2 (Exact inverse sum set theorem) Suppose that $A$, $B$ are additive sets with common ambient group Z . Then the following are equivalent:
- $|A + B| = |A|$;
- there exists a finite subgroup $G$ of $Z$ such that $B$ is contained in a coset of $G$, and A is a union of cosets of $G$.
It is straight forward to show that 1 implies 2. But how can we get the reverse direction work?
To prove 2 implies 1: Let $B \subset b+G$ and $A = \cup (a_i+G).$ Then $B+A$ will be $\cup (a_i+b+G)$, which has the same magnitude.
To prove 1 implies 2: Clearly we can translate $B$ without affecting the truth of $|A+B| = |B|$, so WLOG $B$ contains 0. Let $G$ be the subgroup generated by $B.$ Now, $B$ is clearly contained in $G$ (and when we undo the translate this becomes $B$ is contained in a coset of $G$.) Now, note that $A+B$ contains $A$ (As $B$ contains 0.) Since $|A+B| = |A|$, this implies $A+B = A.$
Therefore, if $a \in A$ and $b \in B$, $a+b = a'$ for some $a' \in A.$ Repeating this, we get that for all $a \in A$ and $b$ a linear combination of elements in $B$, $a+b \in A,$ or equivalent, for all $a \in A$ and $b \in G$, $a+b \in A.$
This tells you that $A = \displaystyle\cup_{a\in A} (a+G)$, which proves that $A$ is a union of cosets, as desired.