Conservation of Momentum
Momentum is conserved in both cases, even though in the both cases complicated things are going on the causes the cars to bounce or to stick together.
For an isolated system (no external forecs) momentum is conserved no matter how complicated!
Momentum is conserved in all these cases.