These are also known as "hair muscles". These are tiny muslces that are attached to the hair shaft. These muscles cause the hair to stand up or be erect. When the Arrector Pili muscles contract due to stress, fear or other nervous conditions, the hair becomes stiff and will actually "stand on end".
Daily Hair Tip
Hair at the nape of the neck often misbehaves because it is where finer baby hair grows. Harness baby locks w/ faux-jeweled claw clips or smooth on your favorite hair paste or wax to hold fragile strands in place.