I hunting rifles they are safe. Tested at the National Test Bench, they undergo considerable stresses and therefore offer very high reliability. When the barrels burst it happens, almost always, not due to defects in workmanship or metal but for a reckless or at least imprudent use. There was a time when many hunters loaded their cartridges: there was a lot of talk about miraculous "doses" (of powder) and often those who said it had no technical notion on which to base their beliefs.
The barrel can burst if there is a little dirt or a piece of wood inside it or, as a result of a defective cartridge, the wad remains. In some cases the barrels burst or undergo swelling due to the so-called long fires, i.e. ignition delays.
They are usually caused by an imperfection of the primer or of the capsule, inadequacy of the wad or imperfect rim, damaged cartridge, insufficient shot load.
When the long fire occurs, a part of the explosive that pushes shot and wads into the barrel is burned, then the combustion of the remaining part of the powder raises the pressure that finds an obstacle in the part ejected first.
It can happen that fewer pellets not only do not go farther but can even detonate the weapon.