Why did the siege of Vicksburg succeed when attacks in Vicksburg had failed?

Federal assaults on Vicksburg failed in more than one attempt to capture this important Confederate stronghold on the Mississippi River. For example the first attempt to force Vicksburg to surrender by Admiral Farragut was a dismal failure. The key was the excellent defensive position of this fortress city. It was high on a mountain-like bluff. It had ample cannon support to hamper assaults from the Mississippi River, and to a large extent it was protected by swampy land, making military assaults very difficult. As an aside, the final capitulation of the fortress-city stronghold put to lie the contention by Union General Halleck that the Confederacy held a distinct advantage because of its interior position. The position, however, did display how difficult it was at various points in time of the war, for even overwhelming Union troop numbers to succeed at will in its Western theater adventures. The use of the term "overwhelming" is not exaggerated. For example, it took Grant's forces of 23,000 troops to over run a Confederate defending force of 6,000 troops in one early part of the upcoming siege.

General Grant's strategy to encircle Vicksburg and cut off all resupply meant that all of the townspeople and many thousands of soldiers would have to live on the small amount of food available. The southern attempts to break the blockade failed and the food ran out.