When researching wood finishes, I often see that varnish is attributed with the ability to "protect" wood. In what way does varnish protect wood? From scratching? From fading? From moisture? From direct contact with water? From something else?
Generally speaking, varnish makes the wood look pretty and shiny and protects it from water although the protection is not perfect.
A much better explanation can be found in the book Understanding Wood Finishing by Bob Flexner.
It has been through several editions so your local public library should have a copy. He debunks a lot of myths and is pretty scientific while still being practical.
 I feel like I trivialized the question in my first answer. Here is a bit more on the topic.
Wood has pores in it and so the pores will fill up with dirt, oil from your hands, and schmutz in general. The finish you put on the wood will protect it from this and make it easier to clean off. It also protects the wood from water although how much protection it gives depends on the finish. Varnish does a pretty good job with both of these.
Furthermore, polyurethane varnish often has UV blockers in it to protect the wood from changes in color due to sunlight (or UV from whatever source). No finish does a very good job of protecting from scratches but some finishes are more easily repaired from scratches than others.
As @bib says in his comment, the purpose of the finish is really dependent on what the wood is being used for. Most wood finishes will provided at least a little protection from drying and abrasion, but other than that it's really application specific. (By the way you use the word "varnish", which is a specific category of wood finishes, but there are many others.)
... and about 20 more types.
Varnish is a clear, transparent substance that is used on woods. But why? Well, not only does it give the wood a shiny glow, it also blocks up the tiny holes in the wood.This prevents the wood from absorbing the water, which can cause it to swell, rot and smell quite badly