via dopamine/endorphins, and may help with muscle recovery after a workout, among other things. Basically the same stuff as cold plunge. I've heard the studies show you can benefit from at least 11 minutes total per week of cold exposure. I think Andrew Huberman talked about the study on his podcast a while back. I'll see if I can dig it up.
A while back I started ending my morning shower with around 2-3 minutes of cold water. It sucks at first, but I do believe it helps with my mood as there is a noticeable dopamine hit in the hour or so after for me. I don't know about all the other stuff.