It's a special case of $\,\ \bbox[5px,border:1px solid #c00]{n\mid k\iff n\mid (k\bmod n)}\,\ $ by $\ k\bmod n = k - qn\,$ for $\,q\in\Bbb Z$
Hence $\,\ 2^{\large b}\!-1\mid\, 2^{\large r+qb}\!+1\iff 2^{\large b}\!-1\,\mid \underbrace{(2^{\large r+qb}\!+1\,\bmod\ 2^{\large b}\!-1) = \color{#0a0}{2^{\large r}}+1}_{\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\textstyle\bmod \underbrace{2^{\large b}\!-1}_{\textstyle \color{#c00}{2^{\large b}\!\equiv 1}}:\ \ \ 2^{\large r+qb}+1\equiv 2^{\large r}(\color{#c00}{2^{\large b}})^{\large q}\!+1\equiv \color{#0a0}{2^{\large r}}\!+1}$
Generally if $\, n\mid k-k'\, $ then $\, n\mid k\iff n\mid k'\ $ is true in any commutative ring. Said in modular language: $\ $ if $\ k\equiv k'\ $ then $\, k\equiv 0\iff k'\equiv 0\ \pmod{\!n}$
The boxed equivalence can be viewed as divisibilty analog of the fact that it is valid to simplify modular expressions by reducing $\bmod n$ the arguments of sums and products (in the above special case of testing for zero-equivalence). Generally it's easiest to immediately convert divisibility relations into the corresponding modular arithmetic operations (where we have much stronger intuition).
The above proof generalizes from $\,2^n$ to $\,a^n.\,$ The key idea is to use modular order reduction on exponents as in the Theorem below. We can find small exponents $\,e\,$ such that $\,a^{\large e}\equiv 1\,$ either by Euler's totient or Fermat's little theorem (or by Carmichael's lambda generalization), along with obvious roots of $\,1\,$ such as $\,(-1)^2\equiv 1.$
Theorem $ \ \ $ Suppose that: $\,\ \color{#c00}{a^{\large e}\equiv\, 1}\,\pmod{\! m}\ $ and $\, e>0,\ n,k\ge 0\,$ are integers. Then
$\qquad n\equiv k\pmod{\! \color{#c00}e}\,\Longrightarrow\,a^{\large n}\equiv a^{\large k}\pmod{\!m}.\ $ Further, $ $ conversely
$\qquad n\equiv k\pmod{\! \color{#c00}e}\,\Longleftarrow\,a^{\large n}\equiv a^{\large k}\pmod{\!m}\ \, $ if $\,a\,$ has order $\,\color{#c00}e\,$ mod $\,m$
Proof $\ $ Wlog $\,n\ge k\,$ so $\,a^{\large n-k} a^{\large k}\equiv a^{\large k}\!\iff a^{\large n-k}\equiv 1\iff n\equiv k\pmod{\!e}\,$ by here, where we cancelled $\,a^{\large k}\,$ using $\,a^{\large e}\equiv 1\,\Rightarrow\, a\,$ is invertible so cancellable (cf. below Remark).
Corollary $\ \ \bbox[7px,border:1px solid #c00]{\!\bmod m\!:\,\ \color{#c00}{a^{\large e}\equiv 1}\,\Rightarrow\, a^{\large n}\equiv a^{\large n\bmod \color{#c00}e}}\,\ $ by $\ n\equiv n\bmod e\,\pmod{\!e}$