Probably by a phenomenon of vasoconstriction. But the recurrence is not ruled out if the causal factor is not removed (chronic constipation, tobacco or spicy food).
Sudden changes in temperature from hot to cold and vice versa have always been good for general health, and people have been boosting their immunity this way for centuries. I think it's a matter of pure circulation improvement, which is more than enough if practiced regularly.
It doesn't prevent the development of haemorrhoids, but it has a benefit of reducing the size of already developed ones ( not curing ) especially strangulated type.
1. as an alternative to the traumatic effects wiping with paper 2. By vasoconstriction. 3. By causing the reflex contraction of Horner’s muscle attached to the anal mucosa at the level of the dentate line.