Loops were originally holes in the thick stone walls of a medieval fortress.
Some of these holes were small and used for observation.
Others were slits that widened on the inside, enabling an archer to safely shoot out arrows during a siege.
Finally, these walls had larger, hidden loops or openings through which it was possible to escape during a losing battle.
These escape “loopholes” gave us the modern meaning of the word.