Astronauts headgear

Why do astronauts were those caps under their helmets?

You know the ones I mean? Black on the sides, a wide white stripe across the top going from front to back?

If your earphones slip within your helmet you are fucked. If they are attached to a full balaclava-like cap they are much less likely to slip.

Thanks, Telemark.

I was watching The Martian last night and Damon pulled one of them off his head like it was an ordinary ski cap.