Thinking is a mental process, so it is done in virtue of having a mind that enables thinking. If the mind is identical to the brain, then thinking is a brain process. However, descriptions of mental phenomena don't seem to be reducible to descriptions of neurophysiological processes in the way that the laws of chemistry are widely held to be reducible (in principle) to the laws of physics.