The man beside me at the blackjack table, a tipsy, middle-aged salesman, was on a winning streak. Again and again, over half an hour of play, he’d drawn the cards he’d needed to beat the dealer, amassing stacks of $100 chips that came, by my count, to more than $6,000. Fortune was smiling on him, but not on me—I was down $200. It was hard not to feel like I was doing something wrong, even though I was playing by the book, employing what blackjack manuals call “perfect strategy.” As the salesman’s streak continued, my sense of self-pity deepened to the point that I began to place irrational bets, playing wild hunches that didn’t pan out and left me even further in the hole. Experience told me that it was time to stop, and so I did, fighting a voice that told me to play on, that my rotten luck was bound to change. An hour later, I passed by the table and saw the salesman sitting with his head down, his winnings gone. He’d listened to another voice, apparently: One that told him his marvelous luck would carry on.

Since taking up gambling in my early 30s, I’ve learned that the casino is a harsh classroom. In a thousand ways, it has taught me two main lessons: that the odds are the odds, and they will always ultimately prevail; and that the mind (and particularly the ego) is full of trickery. These tricks take myriad forms, but they share a common theme: The odds apply chiefly to others. You are special.

And sometimes, indeed you are. A few years back, I found myself at the roulette wheel, touched by magic, favored by the gods. Operating on whimsy and intuition, I placed my bets without thinking—red, red, black—and then watched as the little ball cooperated, seeming to obey my will. As it happened, I’d just sold a book for a nice sum and didn’t need the money, which I told myself was the reason I was winning. I’d noticed more than once that gambling during times of famine tended to intensify the famine, while gambling in times of bounty brought more bounty. Why was this, I wondered? I had a theory. When times were good, I played lightheartedly and rode the odds with a sort of cheerful fatalism, attracting happy outcomes, but in bad times I played anxiously, succumbing to despair and greed, making me a magnet for disaster. This theory, like most of my brilliant gambling formulas, was eventually shown to be just another figment of my self-centered imagination, but for one blessed night it felt like a great truth. Though maybe, I realize now, it was a truth specific to me, a hangover from a puritanical upbringing that taught me God was watching my every move, aiding me when I was productive and thwarting me when I wanted something for nothing.

For a couple of years, I obeyed a personal rule that three consecutive wins at blackjack mandated a tripling of my bet. For a while, this ritual served me well, consistently fattening my take, but when it stopped “working,” I persisted in it out of a kind of stubborn, wounded pride. One superstition that haunts me to this very day is that there are certain female blackjack dealers who can see through me to my sinful soul. These women cannot be beaten, I’m convinced, and if I happen to spot one at a table—they tend to have stony faces and narrow, dark eyes—I move along as though I’ve seen a ghost. On what is this superstition based? A single losing night of cards that happened almost 20 years ago, or was it a deeper conflict from long before that? “I have eyes in the back of my head,” my mother would say whenever I was misbehaving, or merely considering it. I’d taken her words literally, it seemed.

Knowing that gambling is a losing proposition, why do I go on doing it at all? The adrenaline rush has subsided over the years, and been replaced by a headier, more subtle thrill: The pleasure of seeing my mind turned inside out, its contents projected onto the green felt tables in the form of hunches, fantasies, and obsessions. Like a kind of funhouse psychotherapy, gambling shows you who you are by lighting up the dark corners of the self and exposing the grandiose workings of the ego—the voice that convinces us that life obeys our wishes, that past injustices will be made up for, or that, just this once, things will go our way simply because we deserve it, the odds be damned.