You're asking what's probably the second biggest question in neuroscience, and no one has definitively answered it. The activity of verbal mental modeling, thinking, is extremely complex and many different parts of the brain contribute to the process. Two exceptionally important areas are Broca's Area and Wernicke's area, without which we can't form language.
And your question is closely tied to the biggest one in neuroscience, "How are we aware?" What's the mechanism by which we are conscious of our thinking? How does consciousness arise from the activity of neurons?
At this early stage there are only many hypotheses and speculations.