'Think' and 'thank' are from the same root — to thank was to think favorably of someone.
To use the mind to consider, reason, or reflect; to form an opinion or judgment by exercising the intellect.
From Old English 'þencan' (to think, consider, intend), from Proto-Germanic *þankijaną (to think), from the PIE root *tong- meaning 'to think, to feel.' The same Germanic root produced 'thank' (Old English 'þancian,' originally 'to think favorably of') and 'thought' (Old English 'þōht'). In Old English, 'þencan' (to think) was distinct from 'þyncan' (to seem, to appear) — the latter survives in the archaic 'methinks' ('it seems to me'). Key roots: *tong- (Proto-Indo-European: "to think, to feel").