They protect the head from the sun in summer, the cold in winter, and keep the dirt out when you clean.
Here is how to tie a scarf for the clueless:
How to Tie a Head Scarf -- powered by ehow
more ways HERE and HERE
when I came back from Africa, I wore a "duka" outside to protect my bun... where you take a scarf and tie it behind your head with the tip of the scarf tuked in...but I gave it up when I moved to Minnesota and had to wear a heavier hat.