Squat cage, also known as 'power cage' or sometimes, 'power rack', is one of the most essential pieces of exercise equipment of any serious lifter, for many reasons.
Squat cage allows lifter to do heavy squats without exiting 'workout area' no matter what. And in the case of bad lift and dropped weights, safety pins prevent weights from hitting the floor - or the person inside the cage doing the lifting.
For maximum safety, it is vital to position safety pins on proper height, which is usually around 5-10cm (2-4 inches) below bar's lowest position during squat. This way, if the lifter is unable to lift the loaded bar, bar can be safely dropped or gently lowered from the back (normal squat) or chest (front squat), with minimum distance from the safety pins, without any damage to the cage or bar and avoiding injuries.
However, if the bar is dropped from certain height (regardless of the reasons), safety pins will stop the bar before it hits the floor or lifter - such lifts should be avoided, but they happen when bars are overloaded or lifter simply makes an error or passes out.
Out of shape safety pins are normal occurrence in any commercial gym and they should be periodically changed - they are not too expensive, at least not when compared with possible injuries they prevent like broken legs, arms, jaws, spine, neck etc. Seriously.
Squat cage can be used for other exercises, too. Various pull-ups and chin-ups are possible with or (sometimes) without dedicated pull-up bar. Deadlifts, bench press, rows etc. from pins are common exercises often used for pushing trough critical points and preparing personal records.
Also, many squat cages can be used as weight stands.
Squat cages have cons, too: they are big, heavy, require plenty of space and can be quite costly.
Plans for DIY squat cages are available online and when properly done, homemade squat cages are as good as commercial squat cages - sometimes even better, depending on the quality and thickness of used material and quality of welds!