We all have tiny muscles around the hair follicle. The arrector pili 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.
Each arrector pili is composed of a bundle of smooth muscle fibres which attach to several follicles (a follicular unit), and is innervated by the sympathetic branch of the autonomic nervous system. The contraction of the muscle is then involuntary–stresses such as cold, fear etc. may stimulate the sympathetic nervous system, and thus cause contraction.
Contraction of the muscles has a number of different purposes. Its principal function in the majority of mammals is to provide insulation: air becomes trapped between the erect hairs, helping the animal retain heat. Erection of the porcupine's long, thick hairs causes the animal to become more intimidating, scaring predators. Pressure exerted by the muscle may cause sebum to be forced along the hair follicle towards the surface, protecting the hair.