When Carson Palmer, the two-time Pro Bowl quarterback for the Arizona Cardinals, hurt his elbow a few years ago, he took a week off from throwing the football. But in his head, Palmer practiced every day. “You stand right behind the center, and you see the coverage unfold as you would if you had the ball in your hands,” he told ESPN. It seemed to do the job. The following weekend, Palmer had the best game of his career.

For more than a century, scientists have been trying to understand how this mental training works. In the 1930s, researchers demonstrated that when you’re imagining an action, your brain sends signals to your muscles—subtle triggers too weak to make the muscles contract but ones that might help train the body to perform. Alternatively, mental practice might create a blueprint in your head, like an inner how-to guide for a particular skill.

Sports psychologists have conducted hundreds of studies comparing imagined and physical practice for actions such as throwing darts, juggling, and tap dancing. Overall, the research shows that mental training works. A 2012 study, for example, compared 32 amateur golfers who putted to another 32 who merely held a golf club in their hands and visualized their swings. Under the same training regimen, both groups improved their putts by getting the ball about 4 inches closer to the hole.

Visualization has advantages over the real thing: You can do it anywhere, even when injured. It’s safe—a major plus for high-stakes performers such as gymnasts and surgeons. And you can practice for longer periods of time because you’re not constrained by physical fatigue. That’s not to say it’s easy: “We’ve had Olympic-level athletes sitting in our lab, visualizing for two hours,” says Tadhg MacIntyre, a sports psychologist at the University of Limerick in Ireland. “When we’re done, they’re absolutely exhausted.”

It doesn’t work for everyone, though. “If you’re a novice, the impact can be negative,” warns MacIntyre. “If you’re trying to visualize a free throw, and you don’t even know the proper handgrip and movement, then you’re probably going to mentally rehearse the wrong skill, and your skill is going to be impaired.”

This article was originally published in the September 2015 issue of Popular Science.