A rear derailleur hanger is a part which connects to the rear frame. A rear mech derailleur hanger which is able to disassemble and assemble, is known as Safety insert feature.
For the frame without Safety insert feature
A rear derailleur hanger is welded to the frame. When it is broken, you cannot replace a new one.
If having a strong collision on the rear derailleur, the frame can be lop-side over the center of the wheel or the part that attach to the wheel is able to get out of shape. Further, the hanger can be broken and the frame is over.
You can use specialized tools to bend the hook, but it cannot be of no purpose to the frame. Moreover, you should consider for adjusting as it will be worse and worse if you do not fix correctly.
Picture: Tools to adjust the rear derailleur hanger
For the frame with Safety Insert feature
A mech hanger are of course a “sacrificial part” designed with the frame. It is attached to bike by bolts screws or both, from inside or outside the frame. If there are any collisions, it reduces or eliminate damage to your frame & drivetrain parts.
The hook is easy to replace or assemble by screw the bolt out.
You can use professional tool to adjust if the hook if it is smashed gently, which does not affect to the frame.
Applying this feature will reduce damage to the frame and save a lot of money and time to fix over other frames.