First time here I've been dumbstruck. I have no idea. Such an integral part of my lifestyle, and it is a complete mystery to me.
I do think that it is very complicated and different things can be true for different people. I've got no trouble seeing what pain makes who happy, but why this happens is a tough one.
Maybe the problem is simply down to definition. Pain is an umbrella definition of a large group of sensations generally conected to discomfort. But if a person is enjoying it, then the basic definition fails. But here it'll fast get amazingly complicated and I'm really just guessing.