The answer to that is biology not psychology (although it's a subset anyway) so this may not be relevant or necessary for you to know (it's also based on my understanding and since I never liked neuro much, it may not be accurate)
You're right about glutamate. Glutamate binds its receptor, which is known as NMDAR, and is the trigger for new synapse formation. There are a bunch of changes within the cell in response to this trigger. You're also right about dendrites being involved. In response to the glutamate trigger, they will rearrange their cytoskeleton to form new synapses with other neuron axons. This basically involves a restructuring to form new projections, neurotransmitter storage etc. that can form a new synapse.
Since glutamate is the key neurotransmitter between neurons, the more you use particular neural pathways, the more synapse formation you get.