Castle defence and attack were often often nicely balanced. The attackers did not really want to lay siege to the castle, however.
If the defenders saw the attackers were too strong, they came to a gentleman's agreement to leave the castle with flags flying.
If they held out and lost, the defenders could expect no mercy.