In what way does varnish protect wood?
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.

[edit] 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.