Why does a force-time graph in a collision generally sinusoidal/triangular-shaped, and not constant? When in physics class, we are generally shown a graph such as this:

And we are then told to calculate the impulse. We can easily do this by taking the integral of force with respect to time. But why is a force-time graph shaped like this? For example, if I threw a ball against a wall, why isn't the wall exerting just a constant force on the ball? Why does force vary over the time into the collision? And at what point in the collision does the local max occur?
 A: Because it isn't constant. Think of a person jumping on a trampoline (with their legs straight). The amount of force exerted by the trampoline to the person depends solely on the amount of deformation of the surface (or otherwise the position of the person). The more deflection the higher the force and the higher the acceleration.
In this case you can write that acceleration is linearly dependent on displacement $$\ddot{x} = -\frac{k}{m} \, x$$
The solution to that is $$x(t) = -\delta \cos(\omega t)$$ and $$F(t) = -k x(t) = k \delta \cos(\omega t)$$
The general case is far more complicated, but the idea is that force is a function of deformation and the deformation in a contact goes from zero to maximum and back to zero. That's why it is shown as a triangle shape. It represents the concept of elastic contact forces.
A: There's a popular analogy where collision is related to a system in which a block approaches another block having spring attached to its rear end. 

In actual collsion of two bodies, the spring in between is replaced by their elastic nature. As the two bodies press against each other after coming in contact, their deformations increase. And, just like in a spring, the force exerted by one body on another is related to this deformation.
With time, the deformation varies and so does the force. This results in a non-constant force v/s time graph.
