If you’re having surgery in the middle part of your foot with hardware (pins), it sounds like you injured the tarsometatarsal joints, which is where the bones in your foot all seem to join up.
If the fracture is unstable, meaning the bones have moved, then surgery is usually the chosen treatment. In cases like arms and legs, the hardware is usually left in because of the type of bone and the part of the body affected. But, with the foot, the motion of the feet, the pressure on the ball of the feet and the joints when taking every step, can eventually cause the hardware to break due to fatigue. This can cause even more problems.
Some doctors do leave the hardware but this is a decision best left between you and your own surgeon.