What are car bodies made from?

Most auto bodies are made of sheet metal (steel) and aluminum in varying mixes. More and more parts are being made of carbon fiber (for it's low weight) although the expense of carbon fiber has, to date, kept the production to a minimum. Some vehicles such as the Corvette are made of fiberglass.

I think they are used for crash saftey.

In modern cars and other vehicles, the frame is a highly engineered crash-absorption component that can help to protect you and your family in a collision by dispersing impact forces more predictably. Every year, hundreds of thousands of used vehicles with hidden frame damage to that very component are bought and sold, usually for one of two reasons:
1. Typical visual frame inspection procedures for new or pre owned vehicles used by even the most reputable car dealers can actually fail to detect hidden auto frame damage from a common collision.

2. Unscrupulous individuals are "passing off" a salvaged car that has been totalled and refurbished, but not repaired correctly or to vehicle safety specifications.

How Frames React In Collisions
Safety engineering has made incredible leaps in the past few decades of automotive design. Frame structure and manufacturing has played a significant role in many of these automotive advances.

Just as the highly technical design of an Indy race car keeps its driver alive in an otherwise horrendous crash, the design and integrity of a frame dictates how a passenger car or truck "behaves" in a collision. Crumple zones are precisely engineered to absorb impact and protect you and your family. Air bag deployment is also affected by frame design.

For every vehicle, the manufacturer has developed the ideal behavior characteristics of the frame seen in automobile crash tests. Auto frame damage can compromise your vehicle safety even in a minor rear-end collision by changing your car's alignment, crumple zones or air bag deployment.
Impact Damage When your car is in a collision, its frame can become damaged in two ways. First, the accident can result in direct damage to the frame, which appears at the location of impact. For instance, as you might expect in a rear-end collision, the rearmost sections of your vehicle frame may be damaged.