Excellent insights on human behavior in "Gambling Severity Predicts Midbrain Response to Near-Miss Outcomes" by Henry W. Chase and Luke Clark in The Journal of Neuroscience here.
"During gambling, players experience a range of cognitive distortions that promote an overestimation of the chances of winning. Near-miss outcomes are thought to fuel these distortions."
This applies to all activities that are competitive, yet for the astute, this applies to activities where some sort of fulfillment is desired as well.
If you do not have access to the above article, see a recap here at the Economist - "IT IS not the thrill of winning, but the thrill of almost winning that sets a problem gambler apart from those who just fancy a flutter. A strong reaction in the brain in response to “near misses” is correlated with a greater tendency to compulsive gambling, according to new research."