I think you may have already answered your own question. The physical processes that materialists say are the actual underlying activity behind what others see as "thought" are the motive force behind the change. Look at it this way- if I'm a materialist, I claim that your experience of consciousness is actually a complex set of physical/molecular interactions. I claim that things like thoughts and memories are actually physical processes located in physical parts of the brain. And just like a river can cut a path with it's own physical movement, so can electro chemical activities strengthen (perhaps etch?) neural pathways in the brain substance. This process could be similar to how a weight lifter enhances certain muscle groups through using them over and over. So as a materialist, I am perfectly OK with what "YOU" call thoughts (but I consider physical interactions) being able to modify my brain in physical ways. Physical activities can have physical effects.. What's inconsistent about that? "You" believe thoughts are non-physical things, and "I" believe they are an illusion. But the key thing is, my belief that thoughts aren't "real" doesn't mean I see the underlying actual cause as also illusory. This underlying physical cause is what I (as a materialist) say causes physical changes to the brain. See?