I believe it has to do with evolution. Physical movement is important in the evolution of higher intelligence. It is very natural for humans to “fidget/move while thinking”. I’m having trouble putting it into the right words. So, I searched the web and found this is closest to what I’m trying to say, although not as close I want ..lol:
“Step back a half-billion years ago, to when the first nerve cells developed. The original need for a nervous system was to coordinate movement, so an organism could go find food, instead of waiting for the food to come to it. Jellyfish and sea anemone, the first animals to create nerve cells, had a tremendous advantage over the sponges that waited brainlessly for dinner to arrive.
After millions of generations of experimentation, nervous systems evolved some amazing ways of going out to eat. But behind all the myriad forms of life today, the primary directive remains. Movement. In fact, a diminished ability to move is a good measure of aging. Inflexibility heralds death, while a flexible body and fluid mind are the hallmarks of youth.”
Source
When I’m thinking about something that’s more complex at home, I tend to have a tennis ball in my hand. It has helped my studying over the years as well.