The arrector pili muscles, also known as hair erector muscles, are small muscles attached to hair follicles in mammals. Contraction of these muscles causes the hairs to stand on end, known colloquially as goose bumps.
Contraction of arrector pili muscles have a principal function in the majority of mammals of providing thermal insulation. Air becomes trapped between the erect hairs, helping the animal retain heat.
Many animals experience contraction of the arrector pili muscle in response to a perceived threat. This helps the animal seem larger and more intimidating as a result.
Sebum excretion
Pressure exerted by the muscle may cause sebum to be forced along the hair follicle towards the surface, protecting the hair.