The usage in reference to a hidey-hole for purposes of evading capture seems to be an extended meaning

I think this is what was troubling me. I knew the trap door spider used a pit to ambush its prey, but this seemed to be more of a defensive situation. Thanks for the clarification.