They are typically used to reinforce the vehicle and ensure that the passenger is protected in the event of an accident particularly if the car rolls.
Building a roll cage 101.
A roll cage is a metal framework that can be built around the inside of a vehicle.
Shown here is a visual difference between your basic 4 point roll cage and an 8 point roll cage from the chris alston s chassisworks catalog.
Adding diagonal main hoop support braces turns it into and 8 point roll bar.
Then you build upon that by adding bars for an 8 point roll cage then progress to an 8 50 or 10 point roll cage.
The bars shown in blue are optional.
A standard feature in race.