In case of conflict, the Door of Betrayal allowed for discrete access to the exterior, and as a final resort to take flight.
It was usually located in the most uneven and least used part of the fortification.
Because it was an opening in the wall, it also allowed for enemy access to the interior. That's how, the use of the term ‘betrayal’ came.