Lincoln said that the key to winning the war was to cut off the South’s water circulation (i.e. the Mississippi River) and cut off three states. He assigned U.S. Grant to be in charge. Later Grant had three Major Generals commanding three corps, General Sherman, General McLernand and General McPherson. Admiral Porter was in charge of the Navy.
The U.S. controlled New Orleans and some of the Mississippi north of it, and controlled the Mississippi north of Memphis. They had to take Vicksburg, deep in enemy territory, to control the river. It was on a cliff and was well defended by artillery and Confederate infantry. General Johnston, who was very offensive, and General Pemberton, who was defensive, were in charge of Vicksburg for the Confederates.