'Gloss/matte' and 'varnish' are two related, but different concepts.
Gloss, satin (or semi-gloss), and matte (or flat) are finishes, which is to say they describe the specularity (shininess) of a painted figure. Paints have finishes, as do varnishes, mediums, primers, and anything else you'd apply to a model. Most
GW/Vallejo/P3 paints are somewhere between matte and satin.
Varnish is a clear product which is designed to go over paint, to provide protection and/or to control the finish. Typically, varnishes are described by their base, which today is usually acrylic for brush-on/airbrush or lacquer for spray, and by the finish they produce.
You are correct in your interpretation that varnish is the spray often used to protect paint, but it also has the secondary effect of determining the finish of the model.
There is a common myth that gloss varnishes provide more protection than matte. This is technically incorrect, but a matte finish requires a lighter dusting of varnish than gloss to get the intended finish, so gloss can be applied more heavily and consequently provides a better protective coat. You can use a sequence of different products to get the desired finish.
Typically, you'd want to use satin or matte for most figures. Matte gives the most realistic appearance, but satin provides deeper color and more 'pop' thanks to its shine. Gloss is normally reserved for specific areas meant to be shiny, like gems, lenses, or water.
Here's an example of multiple different finishes together. These models have been sprayed with lacquer gloss varnish, followed by lacquer matte varnish, followed by acrylic ultra-matte varnish. This sequence produces a very durable matte finish. Lastly, I used an acrylic gloss floor finish on just the puddles on the bases to give them the shine.