It trains the mind. For example if you picked up the flute only once, or the guitar only once, and learned a few scales, but you have to think in order to play them. In the dream your subconscious mind is learning it so that when you are awake you won't have to think as hard. It will be more automatic.
That is how I mastered bebop scales.