1, or to prevent hair from hitting eyes and cheeks.
2, or to prevent sweat from dripping into the eyes and not seeing clearly.
It is uncomfortable for people with long hair to fly around during exercise.
Otherwise, it's basically B.
For example, some people with short hair wear hair bands to prevent sweat from affecting their eyesight and protect their heads. For example, some players in the NBA.