Boxing gives you confidence to avoid a street fight.
You don't feel you have to prove yourself.
But in the case that if someone attacks you, you know how to keep enough distance so that they can't even attempt to hit you. If you feel you must, you can strike back.
Unless it is something serious, which I don't call a street fight, more like an attempted mugging.