“When volunteers strolled Stanford's pleasant, leafy campus for about eight minutes, they generated more creative ideas than when they sat either inside or outside for the same length of time. But they were not noticeably more creative as a result of their plain-air walk than when they subsequently walked on an indoor treadmill, facing a blank wall."
According to a study conducted by researchers at Stanford University, headed by Dr. Marily Oppezzo, the mere act of taking a walk can boost/inspire creativity. They hypothesize that this result could be from the expense of energy that frees the mind up, letting creative thought occur, like the lightbulb lighting up above your head. Or, the act of walking could just improve the walker's mood, which could help stimulate free thought.
This study just briefly touches on one aspect on the science of fitness and its affect on the psychological state. How, though, did the researchers conduct this study and reach their specific conclusion? For the study, which is referenced extensively, Dr. Oppezzo and the researchers recruited a group of undergraduate students at Stanford University and had them each take creativity tests. They retested each individual in four different locations/scenarios: sitting in a bland room, walking on a treadmill in a bland room, sitting outside, and lastly, walking around outside.
Through their research, Dr. Oppezzo and her team noted that the volunteers' creativity level scores were significantly lower when they had to take the test while sitting as to when they were tested while walking. The researchers observed that the change in setting, in the room vs. outside, did not have that much of an impact on the test scores. Dr. Oppezzo stated that for boosting creativity, it's not the location that matters but the introduction of light physical activity.
The idea that the creativity stems from mood, which is hypothesized to be affected by walking (or body movement), goes in line with James and Lange's Theory of Emotion. This theory states that the subject's experience of emotion is a result of psychological reactions to physical actions, and in this case, walking around improves mood and stimulates creativity. Although, neither presented indisputable evidence for the study, which was largely based on their opinions.
Theories and other things of the sort aside, I think we could go out on a limb and say the emotional reaction in response to walking caused some people to experience an uplift in their mood, ultimately resulting in a boost in creativity. It's an excuse to get some exercise if nothing else. The idea is that remaining stationary in a seat is bad for the creative juices, so maybe that's why people sometimes feel the need to pace back and forth when they're thinking intensely about something.