Going back to the Middle Ages for this question. During that time, this was the area of Ireland directly under English control. That it was prudent to stay inside it gives us an idiom about unacceptable behavior.
Pale