Basically, there are/were two main ways to win a siege.
Or 2) The much more common method of starving the defenders out until they accepted terms or surrendered. Any enclosed fortification would run out of food and/or water eventually, although this could take years or decades even. This situation could also easily turn on the besiegers. If they were no longer able to forage or maintain a supply line they could easily be the ones to starve first. There was also always the risk of a relief army coming to lift the siege in which case the besiegers would be force to withdraw or fight it out, which would leave them hammer and anvil'd between the relief forces and the defenders.
How could you possible win?
to follow up /r/Edmure post, for the most part you didn't. Castles were hugely important in that era because a handful of men could hold off an army almost indefinitely, assuming they had proper stores. this made the cost of sieges massively disproportionate and almost impossible in most cases.
In the war of Scottish independence Edward I spent three months completing his famous trebuche Warwolf, just think how vulnerable he army would have been to surprise attack during that time, and how huge his forces were to dissuade such an attack; even then he wasn't going to make an attempt on the castle without the scariest siege weapon ever built.