In their book Art & Fear: Observations On the Perils (and Rewards) of Artmaking, David Bayles and Ted Orland say that by their observation the elements that prove to allow a creative person to work are essentially idiosyncratic.
For example, they say, Hemingway discovered that in order to be productive, he needed to stand up while typing.
And, they continue, this discovery of Hemingway's is useless to nearly everyone else: other artists find what they need to be productive is something different.
Most productivity suggestions are naturally from people who found something that worked for them, and so recommend that's what you should do: "The Standing Up Method for Productive Writing".
So in lieu of a working general theory, the solution is to be experimental on a personal level: find a way to measure your productivity, even if subjectively, vary your working conditions in systematic way, and see what makes a difference for you.