Right next to the bottom of a hair in the dermis layer of the skin. (It's not in the hair of the head or the private parts).
The muscles are called arrector pili and they pull the hair upright for both of those reasons and a few others.. let me know if you want to know more :)
Erector spinae
The erector spinae
The erector spinae is a group of muscles that run along the spine and help maintain posture by supporting the spine and keeping the body upright. These muscles also play a role in bending and rotating the spine.
Rectus Abdominis
erector spinae group
The erector pilaris muscles.
arrector pilli
Erector Spinae
Some effective erector spinae exercises to strengthen your back muscles include deadlifts, back extensions, and supermans.
The erector pili are small muscles located at the base of hair follicles in the skin. Their primary function is to contract in response to cold temperatures or emotional stimuli, causing the hair to stand upright, a phenomenon known as piloerection. This action can create an insulating layer of air for warmth and make the individual appear larger in response to threats, although its effectiveness in humans is limited compared to other animals.
erector spinae group