Hiking is fun, but it is also meant to be exercise. That means you will be tired. Ideally, you need your gear to help protect you from the elements and not create extra fatigue from its weight, improper fit, or simply being useless because it is inappropriate for the weather or the type of terrain you are in.
Winter hats should be thick, and wrap around your head pretty well. Ideally, they would cover your ears as well. Your head requires a lot of energy to maintain its temperature and you definitely want to protect it from the elements.
Summer hats tend to have more options and nuances. There are the hats with the round visors which help protect your face, shoulders, and neck from the sun. These hats tend to be most protective from the sun. For better fit, baseball caps are more practical because they tend to wobble a little bit less. Unfortunately baseball hats only protect your face and head, but not your shoulders and back.
For extra protection from the sun, some hikers like to choose trails that are full of trees. The trees can provide natural sun protection.
Obviously you want different qualities out of your hat in different climates, seasons, and types of hikes. There are a few things to consider like whether the hat material will absorb water and moisture that comes either from your body or the elements. If the hat absorbs water, that can be bad for a number of reasons. First, it will become heavier. Second, it may begin to have odors. Third, it will become uncomfortable and unbearable to wear over the course of a long hike. That is one pitfall that many beginner and intermediate hikers run into when they wear the very common baseball cap to protect them from the sun. The cap is almost always made out of cotton and it absorbs sweat as you hike. It isn't an optimal choice when you go on a hike.
There are many modern synthetic materials that are made to prevent moisture absorption. These tend to be slightly (or sometimes substantially) more expensive than the common hats, but if you are a regular hiker, you will probably just need one such hat which should last you for years if you are careful with it and don't lose it. It might be worth the little extra expense.
In the winter, people tend to wear skull caps that fit tightly around the skull to keep the heat inside. They are usually made of wool or cotton. We already discussed the qualities of cotton so we won't do that again. The qualities of wool are slightly different. Wool is slightly better at withstanding moisture. The problem with wool is that it can be itchy and over a period of a long hike, or a multi-day camping trip irritate your skin. If you do choose a wool Winter hat, make sure it is the kind of wool that won't itch.