I've read a few answers about sieges on the sub, and they're always fantastic! Something I've noted is that every answer has said that a breach of the walls meant sure defeat, but also mention the besieged party preparing secondary defensive positions inside the walls to continue the defense. Did these ever work?
To answer this question, we probably want to talk about what it meant to lose a siege from the defender’s perspective. In medieval European warfare there were really degrees of defeat when it came to being on the losing side of a siege. This stems from one important rule of siege warfare during the period: if the attackers took a city/castle by storm the defenders had no rights and could be completely slaughtered without any repercussion and all of their property was forfeit. That’s not to say that every time a city or castle was stormed that literally everyone inside was killed – often a commander would allow looting for a certain length of time, like three days, and then after that they would put a stop to it. More rarely they might spare the lives of the defenders entirely, but actually keeping that promise could be hard as once the attacking soldiers had made it into the city chaos was pretty much inevitable.
So from a defenders perspective the worst case was that you were completely overwhelmed and everybody was killed. Even if you survived somehow, you would have lost all of your possessions. Standard to medieval siege warfare was the offer of surrender, usually presented the moment the attacking army arrived outside the fortified walls. The terms of surrender varied and were often tensely negotiated around, and would often change over the course of a siege, so while you might reject the opening offer of surrender – it was generally felt to be dishonourable or even an act of betrayal to surrender a fortress without putting up some kind of fight – throughout the siege both sides would be sending out feelers to see if the other was interested in negotiating a surrender. These surrenders could even be conditional, a very common one was that if no relief army arrived by x date the fortress would surrender – that put the blame on whoever was supposed to rescue you rather than on the defenders. It also could motivate whoever was in charge of your relief to get their shit together and come save you.
In practice, if you were going to end up surrendering you probably wanted to surrender right before your walls collapsed – that way you could secure the best deal while also clearly having done the most you could and thus avoiding risk of dishonour or accusations of treachery. Of course, that’s much easier said than done.
In this context, a gap being broken in the city or castle’s walls pretty much always had a huge impact on the negotiations. A huge hole in your defences severely weakened your negotiating position and could put a clock on how long you could hold out before the attackers poured in and killed everyone. For this reason, the opening of a gap in the walls usually marked the beginning of the end for the defenders, and often significantly motivated them to seek terms of surrender.
It’s important to remember that the normal people living in the city probably didn’t actually care too much who was ostensibly in charge of it, so it was far better for them to surrender and keep their lives than to keep fighting on behalf of some local rich guy. The garrison, usually stationed in the city’s citadel, might have more of a motivation to hold out longer – they probably were paid by the local lord and wanted to keep having a job – which created a tension between the two. Because citadels were walled off from the city as well as outside, you could have situations where a city surrendered but the citadel did not. This was generally not a great position to be in for the citadel, although there are cases where an isolated citadel was relieved and a city retaken, but a collapse of a city wall section could push for the city to break with the citadel and surrender regardless of what the citadel did – another reason for the citadel to surrender.
Now, there definitely are cases where a breach in the wall did not result in defeat (although I’m struggling to think of many), but in virtually every case a relief army was on its way to the city or castle and the garrison knew it – it’s worth bearing in mind that medieval sieges were rarely airtight, so spies and messengers frequently escaped too and from fortified sites bearing news and messages. This was the main reason to hold out after your walls have begun to collapse – the other being the rarer situation where an attacker refused to offer terms of surrender (or only offered extremely severe ones), in which case you might as well fight on since there was no better alternative.
If you’re interested in the history of siege warfare, I recommend Jim Bradbury’s The Medieval Siege, it’s a great introduction to the subject even if it mostly skips the Early Middle Ages in favour of siege warfare after the year 1000.
If you want to dig in deeper, Peter Purton is currently the reigning expert on medieval siege warfare, and his two volume history on the subject is excellent but dense. For more casual reading, I’d recommend his book The Medieval Siege Engineer, which is a fascinating account of the people who actually did the sieging.