In the following passage:
Understanding what heuristics people use to make these essential metacognitive judgments is essential if we are to understand how people gain and maintain a sense of agency, and, in what that sense consists.
What does "in what" or "in what that sense" mean? Is it correct grammar to write "in what that sense consists"?