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?

More generally:
$$a \lt x \lt b \;\;\iff\;\; \left|x - \frac{a+b}{2}\right| \lt \frac{b-a}{2}$$
That's saying that $x$ is in the interval $\,(a,b)\,$ iff the distance between $\,x\,$ and the midpoint $\,\frac{a+b}{2}\,$ is smaller than half the length of the interval $\,\frac{b-a}{2}\,$.
The given problem follows from the above with $\,a=10\,$ and $\,b=50\,$.
