Ice baths are to reduce inflammation.
Contrast showers are to get blood flowing, reduce DOMs and soreness, and push out lactic acid and cell wastes for recovery.
Contrast showers have been shown to help the CNS recover too, like waking them up or giving them a stretch if you want to think of it like muscles. You want healthy muscles, you work them with exercise. You want to keep the CNS healthy, you work it and recover it. You're making your nerves respond to stimuli.
The blood flows because when the body is too hot, it tries to remove excess heat and cool down to achieve homeostasis (the state of being at normal temp/etc). To do this, blood vessels dilate (get wider) to carry hot blood to the skin. This is why skin will turn red (but not for black people due to pigment), it is the blood coming up to hit the surface and cool.
When you turn cold, the skin contracts to keep the heat form escaping to maintain that homeostasis. That's why the skin makes "goose bumps." It closes to keep hot blood near the core.
Going back and forth makes the blood move around, like any active recovery work.