I am an amateur boxer competing so perhaps I can share some insight.
Basically breathing technique is a major aspect one needs to learn. You can very quickly gas out (lose your breath, which also leads to a lack of oxygen for your essential muscles). Therefore, we learn to breathe through outour noses when you're not tense - i.e. when you jumpropejump-rope and such.
However, the inflow and outflow of air is very different when punching and receiving punches.
First of all, you need to exhale fast when you punch, usually done through your mouth (rather than nose), and through your teeth (you don't want to open your mouth, your jaw can break if you receive a punch). Basically you do it fast when you punch and inhale slowly with your nose afterwards because you don't want a stomach fulllung-full of air when you get potentially punched in itthe stomach - I'm sure most people have tried getting the air knocked out of them, and it's terrible and could lose you a boxing fight!
Boxing is about repetition and muscle memory so you do it when doing bagworkbag-work and mittworkmitt-work as well, to make it second nature.
TL;DR: It's difficult to be punched and you don't want it to happen with a stomachlung full of air.