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
If you lie on your back while you sleep this could cause hair stress leading to split ends in the back. To avoid hair stress tie hair back using a soft scrunchie band.