When I played golf recently, I had one of my best rounds going in years. An important threshold was in play. It came down to the last hole, an uphill par 5. I hit a drive into the fairway, but to a somewhat awkward lie. In hindsight, the smart play was a manageable iron as a lay-up, but here is where I ignored common sense. Instead, I lashed at a 4-wood, which sailed left and out-of-bounds. I made double-bogey.

I tell this story not for the therapeutic purpose of getting it off my chest (although I must say, that does feel better!), but because it illustrates the type of poor decision-making we tend to succumb to late in rounds. And that, we’re starting to learn, comes with a good reason.

A study by the French Institute of Health and Research sought to explore how cognitive thinking is impacted when our brain has been sufficiently taxed. Put simply, it wanted to explain why we do stupid things when we’re tired. The method used was by studying the impulse control of two sets of volunteers—those put through a series of difficult memory tasks over the course of six hours, and those who took it relatively easy over the same period. Ultimately, researchers found the less-taxed group exhibited greater control at day’s end.

What the study underscored is that an overworked brain is no different than your leg muscles in the final miles of a marathon. The simplest task becomes arduous. According to a summary of the French study in Psychology Today, “Hard memory work requires a glut of energy and leaves less available for making good decisions. And when that happens, the cerebral gears start slipping and impulsiveness kicks in.”

While this may in part explain the type of brain cramp a mid-handicapper like me is prone to at inopportune moments, the better case study is a world-class golfer at the end of a particularly stressful week. Consider two of the more prominent major-championship collapses in recent memory—Phil Mickelson double-bogeying the 18th hole at Winged Foot to lose the 2006 U.S. Open and Jordan Spieth putting two shots in the water on the par-3 12th hole at Augusta National to surrender a commanding lead in the 2016 Masters.

It’s not a coincidence that Mickelson and Spieth are two of the more cerebral players in golf, and that both were faced with a complex set of challenges: Mickelson had meticulously analysed every hole at diabolical Winged Foot in search of his first U.S. Open; Spieth was trying to extend a streak of seven consecutive rounds with the lead at Augusta while also clearly fighting his swing.

By Sunday afternoon, both players had expended an inordinate amount of mental energy, and both ended up showing incredibly poor judgment at a crucial moment. Mickelson, after missing the fairway badly on the 18th hole, compounded his mistake by trying to cut a shot onto the green from an improbable angle (he hit more trees). Spieth, meanwhile, saw his three-shot lead in the Masters disappear by taking an aggressive line towards the right-side pin at the 12th. Both players required a degree of impulse control—Mickelson should have punched back into the fairway, Spieth should have aimed at the middle of the green. Perhaps owing to mental fatigue, both failed.

According to the science writer David DiSalvo, a pre-emptive measure to defend against this sort of brain drain is to “guard your mental energy and defer important decisions for when you have more on tap”. That might sound easier said than done. Like it or not, some rounds find you grinding right from the start. But it does speak to the merits of not overcomplicating every decision on the course.

Like golf balls in your bag, you only have so many brain cells to work with. Best not to waste them.