What people call a bumper is usually three things: a plastic cover, an energy absorber behind it, and a reinforcement bar behind that. Damage to the cover is cosmetic; damage further in is not.
What can be repaired
Scuffs and scrapes that have not gone through the plastic. Small cracks and splits, which can be welded or bonded from behind and refinished. Deformation that can be reshaped with heat, since most covers are thermoplastic and have memory. A competent repair here is permanent and invisible.
What cannot
Large tears, particularly through mounting tabs. Missing sections. Multiple cracks radiating from one point, which indicates the plastic is fatigued. Damage around sensor apertures, where the geometry has to be exact. And covers that have already been repaired in the same place.
What the sensors change
Parking sensors, radar and cameras mounted in or behind the bumper have to sit at precise angles. A cover repaired slightly out of shape, or a sensor bracket bent in the impact, puts the sensor a degree off, which becomes a significant error at distance. On a car with forward radar this is the difference between a cosmetic repair and a safety one. See recalibration.
What is behind the cover
The absorber is designed to crush once. If it has, it is replaced, whatever the cover looks like. An impact firm enough to crack the cover has usually loaded the absorber. This is exactly the sort of thing found during a teardown.
Why repair is often better
Original covers fit perfectly and a repaired one keeps that fit. A cheap replacement cover can need hours of adjustment and still leave uneven gaps.