"Our conscious experience is assembled on the fly, as our brains respond to constantly changing inputs, calculate potential courses of action, and execute responses." Michael S. Gazzaniga, p. 1614

The brain predicts and prepares for what might happen. Mice brains run simulations of mazes. Human brains run simulations of human challenges. Thoughts are, in part, brain simulations: practicing our moves.

Reference:

Gazzaniga, Michael S. Who's in Charge?: Free Will and the Science of the Brain. New York: Harper Collins, 2011 Kindle