As a former deputy defense secretary with a long history at the Pentagon, Mr. Carter helped accelerate the production and shipment of weaponry and armored vehicles to protect American troops from roadside bombs during the wars in Iraq and Afghanistan. Now, as the American military is building up again in Iraq, this time to fight Sunni militants with the Islamic State, Mr. Carter must manage the war effort as well as the intense budget pressures on the Pentagon in the face of mandatory spending cuts.