Converting a 32-bit bit pattern into floating point number
Suppose you didn't include that shift of $127$, i.e. your number $\nu$ would have the form $\nu = (-1)^S \cdot M \cdot 2^x$ with $x$ being the exponent.

With $8$ bits for the exponent $x$ can have a value from $0$ to $255$. This means you can represent numbers from $\nu = (-1)^S \cdot M \cdot 2^0$ to $\nu = (-1)^S \cdot M \cdot 2^{255}$ .

However, what if you wanted $\nu$ to be $2^{-10}$? It would not be possible.

For this to be possible you want to allow negative exponents $x$. Instead of $x$ ranging from $0$ to $255$ you introduce a shift of 127 such that $x$ ranges from $-127$ to $+128$ .

Now you can represent numbers $\nu$ that range from $(-1)^S \cdot M \cdot 2^{-127}$ to $(-1)^S \cdot M \cdot 2^{+128}$ .