John Duncan provides an excellent review of the role of the frontal and parietal cortex in higher level cognition.  He argues that they form a multiple-demand (MD) network.  Neurons in this MD network have multiple functions, flexibly adapting their coding to signal different things in different tasks.    Duncan argues that they play a critical role in subdividing complex problems and organizing a coherent sequence of focused parts or subgoals.  The MD network construction of these attentional episodes is thought to be a core function for complex cognition and this function is central to fluid intelligence.