What distinguishes the thoughts of a human being from the thoughts of other animals is that the latter don’t think about their thoughts.
For example, my cat occasionally believes that a mouse is within striking distance. She doesn’t ask herself whether this belief is true or false, or whether the evidence justifies her belief. She merely believes.
Something similar is true of her inclination to pounce on the mouse. She doesn’t ask herself whether attacking and killing the mouse is morally permissible, or not. She merely attacks and kills.
Descartes’s thought – “I think, therefore I am” – is reflexive. Not only does Descartes think, he understands that he thinks, and that other thoughts follow from what he thinks – or so he thinks, and hopes.
As for what Descartes meant, that’s a long and controversial story. The consensus seems to be that it’s impossible to say precisely what he thought, because he was thinking many different things. He might have thought that “I think, therefore I am” was a logical inference. He might have thought it was a self-evident intuition. He might have confused the two.
Did Descartes mean that it was impossible for him not to believe he existed? If so, he hasn’t proven that he exists, because psychological certainty doesn’t necessarily imply truth.
Did he mean that he knows he exists, in the sense that his belief that he exists is justified by the fact that he thinks? If so, he is open to the charge of begging the question: the assertion that he thinks presupposes the assertion that he exists, and therefore can’t be used to justify the latter.
Jaakko Hintikka made sense of this interpretive quandary in a remarkable essay. The “I am” follows not by inference from “I think,” he argued, but rather from the self-defeating consequences of trying to think “I do not exist.”
I can’t persuade myself that I don’t exist, for the same reason that you can’t persuade me that you don’t exist. On the contrary, for you to tell me that you don’t exist supplies me with a good reason to believe the contrary. Similarly, my attempt to persuade myself that I don’t exist does nothing but supply me with evidence that I do.
The relationship between trying to think you don’t exist, and creating evidence that you do exist, is not a relationship between a premise and a conclusion. It is, as Hintikka says, “comparable with that of a process to its product.”
The indubitability of my own existence results from my thinking of it almost as the sound of music results from playing it or (to use Descartes’s own metaphor) light in the sense of illumination (lux) results from the presence of a source of light (lumen). (Jaakko Hintikka, “Cogito, Ergo Sum: Inference or Performance?”)
The relationship of thinking to existence is more causal than logical, though our inability to doubt our existence when trying to do so does depend on the perception of the existential inconsistency (hence futility) of the attempt.