Being born and raised on a cattle ranch, I've worn hats all my life. In fact, for a time, I hit up antique stores almost every week, looking for vintage clothing, including the hats women wore. The hats they sported showed their standing in society. The bigger and flashier the hat, the richer and more prominent they were. Some day I'll drag all those out, along with the fashions of the day which no longer fit. That was when I was MUCH skinner.
At any rate, I wore cowboy hats most every single day growing up. We had never heard of sunscreen, and it probably didn't even exist back then. Our cowboy hats were to keep the dust and dirt out of our hair, which didn't get washed all that often, and to keep from getting sunburned.
Back in the earliest days of pushing cows across the land in order to find enough food to keep them alive, the Mexican Vaqueros wore these large brimmed hats. They hadn't heard of sunscreen either.