How to arrive at the particular form of inequality as answer? 
The stratosphere is the layer of earth's atmosphere that is more than $10$ km and less than $50$ km above the earth's surface. Write an inequality which describes all possible heights $x$, in km, above the earth's surface that are in stratosphere.
Answer: $|x-30|< 20$

I can't seem to understand how we got to the answer. Why did we subtract $30$ from $x$ and where did the $20$ come from?

Further information :
Use this propertie $|y| = \left \lbrace \begin{array}l y\quad &\text{if} \quad y\geq 0\\ -y\quad &\text{if} \quad y< 0 \end{array}\right.$
$|x-30|< 20 \iff \left \lbrace \begin{array}l x-30<20 \quad (x\geq 30)\quad &(1)\\\\-x+30<20 \quad (x< 30)&(2)\end{array}\right.$
$\left .\begin{array}l (1)\quad x-30<20\iff &x<50\\(2)\quad -x+30<20\iff &x>10  \end{array}\right\rbrace \implies \boxed{10<x<50} $
OR :
$|x-30|< 20\iff (x-30)^2<400 \iff x^2-60x+500<0$
$\Delta= (-60)^2-4\times(500)=1600\iff \sqrt{\Delta}=40$
$x_1=\dfrac{60-40}{2}=10  \;\text{ and} \;\quad x_2=\dfrac{60+40}{2}=50 \implies \boxed{10<x<50}$

