Think of it this way: the two cars (if they’re the same weight) create a virtual immovable object at the impact point.
“Brick wall” is doing a lot of work there - note that it’s not the same as hitting a stationary car at 50mph, that car would move. We rarely encounter actual immovable objects on or near the road, which is why a 50+50 head-on is more violent than a 50+0 collision into something softer.
It makes sense as well. If we assume each car has the same mass, and picture the collision from the side, it would appear as if each car was hitting an invisible brick wall that separated them. Or, picture hitting a stationary car while driving 100km/h (perhaps on some frictionless surface) - afterwards, both cars would be sliding at 50km/h.