Good one! The answer is quite simple - it's your body being clever.
Your penis will actually shrink under various conditions - any form of exposure to cold, stress and exercise. It's all to do with your body channeling blood to where it's needed.
When you're cold, your body focuses blood flow to the critical organs. Your "Organ" is NOT critical! Because your penis is "driven" by two spongy shafts, when your body redirects your blood, these shafts are drained, causing your penis to shrink. Under stress your body redirects blood flow to where it's needed for optimal response to the situation, and when you're doing exercise, your body redirects blood-flow to your muscles. Clever, hey!?
A similar thing also happens to your scrotum, to protect your jewels. When it's cold, the skin contracts to draw them closer to your body for heat, and the opposite when it's hot. This ensures the optimal temperature is maintained, to improve sperm production. When you're stressed or in a tense situation, your scrotum will also contract, to draw the jewels closer to your body as a form of protection against possible injury from the "potential" fight that may ensue.
My aunts and mother used to own a small slaughterhouse. I was opposed, of course. But as soon as I saw the aggression of the many males, I had to admit, it might have been necessary. None of the animals suffered, that was the most important. Two of my aunts and my mother had a permit, and I was very vigilent on whether all was done in a propre way (so were they,btw)
As a teen I saw my mother, aunts, sisters and nieces castrate tons and tons of sheep all post mortem of course, as only males were slaughtered because they were soon obselete, they all got used to it real quickly, and only women were allowed (according to them). They had been doing bulls for a short while too, but those were too heavy to handle, even with pulleys. My mother is here now, she helps me in the memory. In the beginning they cut the ram’s seam open, but that meant the leather was wasted, that’s why they operated differently very soon after. It went REALLY quick, as the rams hanged upside down, the first thing their little hands grabbed were soft scrota and they cut the whole package at once at the base with balls and all, so this part wasn’t wasted. It blunted up many knives leather wrapping was important, the balls they just threw in the ball cart. Leather was important and expensive, and as that was very soft… . I didn’t think about it, never wanted to do it myself, my sisters and nieces loved doing it. When rams are young, they are okay, but as from 10-15 months, you can’t do anything with them anymore. My cousins couldn’t handle it, they were like pissed. I wasn’t, women already suffer enough, so now it was their time to rule (a bit). I still have pics from those days. I didn’t know that you could castrate live animals in such tempo. All the women loved doing it, and said : ‘Good thing these things dangle outside’. My mother said ‘It makes the opening easier, and those are the reason they hang here, testicles make you boys aggressive’. After their testes were gone it was just cutting them through the stern bone, and he was open. The rest was quite heavy work on the women. My mother asked me to do the hard work as from my early twenties. They quit the business a few years later.