Put simply, guide vanes direct the air flow so that it impinges on the compressor blades at the optimum angle to induce most 'lift', ie. most rotational force.
The guide vanes can be variable, ie. they move mechanically, so they can be adjusted for different performance in different flight regimes. They would, therefore, contribute to the flow velocity, which is a key function in compressor surge.