There are different designs of springs, such as torsion bars and leaf springs, but nearly all of today's passenger cars use coil springs at all four corners. A lot of trucks use coil springs too, with leaf springs for heavier load capacity typically found on a truck's rear suspension system. They absorb this shock by either compressing or extending. When a car's wheel goes over a bump and gets pushed upward, the spring absorbs that additional load, keeps the road shock from reaching the chassis, and makes sure the tire maintains contact with the pavement. So, say a load of 200 pounds is applied, the spring will deflect 2 inches.
Spring rate comes from various factors.
For a coil spring, this includes the number of active coils, the diameter of the coils, and the diameter of the spring wire. The fewer coils a spring has, the higher the spring rate it will have. The design of a spring affects how well the vehicle will ride and handle. A spring that absorbs lots of energy will generally offer a comfortable ride. But there are always engineering trade-offs.