The referee can stop the fight, and so can the ringside doctor. The referee asks the doctor to check a boxer who has a cut or has been hit hard on the head.
The doctor and the referee decide on the safety of the boxer. Their decision is final.
If a boxer gets hurt by a legal punch and cannot continue, he loses by technical knockout.
A cut from a fair punch is treated by the corner between rounds. The fight can go on as long as the doctor allows it.
If an accidental headbutt or other accidental foul causes an injury and the fight cannot continue, the result depends on the round. Before four completed rounds, it is usually a no contest (some commissions rule a technical draw). After four completed rounds, the scorecards decide, and the boxer ahead wins by technical decision.
Headbutts are often accidental. The referee decides if a clash of heads was accidental or intentional.
If an intentional foul injures a boxer so badly that the fight must stop, the boxer who committed the foul is disqualified.
If the injured boxer can continue, the referee can take points from the boxer who fouled.
In every case, the safety of the boxer is more important than the result.