They will do it to pump themselves up in crucial situations, usually late in a set or late in the match, to give themselves a shot of adrenaline. (You can also do it deliberately by slapping yourself on the side, making yourself feel aggressive, and saying something like, "Come on!!" or "Get going!!" under your breath.)
Paradoxically, this type of adrenaline response is sometimes even useful in counteracting shaky nerves in pressure situations. At such times it is natural to become tight and conservative. Calling up an adrenaline response can sometimes loosen you up. Essentially, you try to turn feelings of fear into feelings of aggression, the physiological correlates of which are quite similar.
Adrenaline is a hormone released by the adrenal gland that makes you stronger and quicker -- sort of a personal afterburner -- but running on it too long can tire you out. It can speed up your reactions, strengthen you when you are getting tired, or help you focus when your concentration is slipping.
However, it's best to use it sparingly -- on occasions when it will do the most good, such as when the finish line is in sight and you need a little something extra to drive you over it.
Players differ in their response to adrenaline, so you will need to learn from experience how often and when to use it. But regardless of what you learn, the vast majority of your points should end with no emotional reaction at all.
Find a tennis tournament near you.