I'm sure you've probably heard this before. These are good questions that deserve attention. First of all, it is important to note that not all vehicles have both shocks and struts. Some have just struts and some vehicles have only shocks.
Shocks are part of the overall suspension, and a strut is a complete suspension assembly.
They dampen spring oscillation, and secondly, they aid in ride control. The shock absorber's function is to dampen the bouncing spring. The shock absorbers in your car aid in ride control by keeping the car manageable during regular driving. They do this by keeping the tires down on the road and not allowing them to bounce after hitting a bump. This allows for ease of cornering and handling.