The kind of soil grapes are grown on has a huge effect on how the wine will turn out. It is generally accepted that a soil that puts stress on the vine makes a better wine. If grape vines had the ideal conditions with plenty of water and nutrient rich soil, they'd spread far and wide, and produce lots of grapes. But that doesn't make very good wine. When vines are stressed, they produce fewer grapes, andy those grapes are much stronger in flavor. This is because the vines are activating a natural defense system. The vine thinks it is dying, so it pours all its energy into making nutrient(and flavor)-rich grapes so it can propagate itself. A stressed vine will also be less leafy, which allows more sunlight to reach the grapes.
In addition, when the soil has plenty of water, the roots spread horizontally to soak up as much water as it can. When the soil doesn't have very much water, the roots are forced to forage deep into the ground, which increases the transfer of minerals, and results in a healthier vine.