Hair standing up attracts and retains more heat from the air than hair lying down, similar to a t-shirt vs a fluffy coat. Having hair stand up when you’re scared makes you look bigger to predators. The mechanism is the same as any other involuntary muscle, like your heartbeat or digestion. The muscles on one side of the hair contract while the other side doesn’t, so your hair becomes raised.
Latest Answers