Modern cars are better designed to withstand collisions from the front and rear than from the sides.
The first line of protection in a collision is the car's protective body. The front and rear parts of the car consist of so-called crumple zones that are developed to collapse during a collision, so that the sequence of events is slowed down.
In a frontal collision, the car's front crumple zone is compressed to absorb the energy from the impact within the outer parts of the vehicle, rather than being directly transferred to the occupants of the car. In a rear-end collision the car's rear crumple zone is compressed.