From what my guru told me, I have constructed a little different model. First of all, brain is an organ, the thinking instrument of the physical body. So is manas for the astral and buddhi for the causal body. Being the subtlest of them, buddhi interpenetrates manas and together they interpenetrate the brain. The sense impulses from the five senses become the raw material. They flow via the network of nerves around the spinal cord and end up at the bottom of the brain, close to medulla oblangata. A valve called taluka, puts them in a linear sequence and hands them over to manas. Manas carries them across the rear brain where long-term memory is located and over the top of the brain where short-term memory is. Prana is ordinarily contaminated but provides eergy to manas and buddhi.
While passing through, the incoming impulses pickup near-identical memory patterns from previous experiencing and knowing. But these patterns are also soaked in past emotions. Eventually they land up in the brain’s frontal lobe which acts as a registration area where the impulses, memory patterns, emotions are churned around by manas and buddhi.That process produces a thought. It contains its own vibratory frequency depending on which constituent was predominant. One thought doesn’t create cognition, hence while buddhi uses its logic for churning, manas transports them back and forth drawing more patterns from memory and storing back “new” patterns. Thought in its essentially coded form gets flushed out from ajna chakra. It is still matter though very rarefied and have life enough to turn the “cause and effect” cycles of karma.
Thoughts create a few other things. They create waves in the astral and causal bodies which Patanjali refers to as chitta-vrutti that puts mind in a perpetual unettled state. Suitable thoughts are also conveyed to the organs of action, like hands and feet. Thoughts build a reservoir in the brain where accumulated judgmental data creates “I” identity and personalized knowledge.
In accomplished Yogis, mainly through pranayama, a bio-physical change takes place. The side passages open for the impulses, to avoid their journey through memory. Such unconditioned impulses create direct perception and no thoughts and get flushed away as impulses that do not last. Yogis can enter samadhi by closing taluka valve, at will, blocking the impulses away from brain, letting prana circulate through the chakras unhindered.