The structural, or pilosebaceous, unit of a hair follicle consists of the hair follicle itself with an attached sebaceous gland and arrector pili muscle.
The hair follicle begins at the surface of the epidermis. For follicles that produce terminal hairs, the hair follicle extends into the deep dermis, and sometimes even subcutis. Meanwhile, follicles producing vellus hairs extend only to the upper reticular dermis. There are three important segments of hair follicles found on the head: the infundibulum, the isthmus, and the lower follicle/inferior segment (which includes the bulb).
The infundibulum segment is the upper portion of the follicle. It begins at the surface of the epidermis and extends to the opening of the sebaceous duct. The isthmus is the area between the sebaceous duct opening and the bulge. The bulge is an area of the follicle marked by the insertion of the arrector pili muscle. Also, the bulge contains several epidermal stem cells that are part of the outer root sheath and stain with CK19, CK15, and CD200. Finally, the inferior segment of the hair follicle extends from the bulge to the base of the follicle. This segment includes the bulb, which contains the follicular matrix surrounding the sides and top of the dermal papilla. The dermal papilla contains capillaries. The papilla interacts with the matrix, which has the highest mitotic rate of any organ. The matrix is the part of the hair follicle where matrix keratinocytes proliferate to form the hair shaft of growing hair. Melanocytes are mixed amongst the matrix cells to provide the hair shaft with color.
The hair shaft consists of an inner core known as the medulla. This is surrounded by the cortex, which makes up the bulk of the hair. Moving outwards, there is a single layer of cells making up the shaft cuticle. The shaft cuticle is then encased in three layers that form the inner (internal) root sheath. The inner sheath is important in shaping the hair shaft as it grows upwards from the matrix. The inner sheath keratinizes from the outside-in, and will eventually disintegrate mid-follicle, around the level of the isthmus. Finally, the outer (external) root sheath encases the entirety of the hair shaft. This layer undergoes trichilemmal keratinization around the level of the isthmus.    
Sebaceous glands are holocrine glands closely associated with hair follicles, especially in certain areas of the skin such as the face. These glands open onto the hair follicles, except in areas such as the lips, where they empty directly onto the mucosa surface because lips do not contain hair follicles. When stimulated by hormones such as androgens, sebaceous glands secrete a lipid-rich sebum that protects the hair and provides the skin with a hydrophobic barrier that can serve as protection.   
Arrector pili muscles insert at the level of the bulge and also attach to the papillary layer of the dermis. In cold climates, sympathetic stimulation causes these muscles to contract. This raises the level of the skin slightly and causes the hair to stand erect, which is commonly referred to as “goose-bumps.” 
Structure and Function
The hair follicle cycles through three different growth phases: anagen, catagen, and telogen.
- The anagen phase is the proliferation phase, and it occurs when the hair follicle is growing a new hair shaft. The length of this phase can vary. For hair on the scalp, the growth phase can last 2 to 6 years, whereas, for eyebrows and eyelashes, hair may only need a few months to grow. This is the only phase during which the inferior segment of the hair follicle is present. To signal the beginning of the anagen phase, the dermal papilla signals to the multipotent epithelial stem cells in the bulge. Once these stem cells are stimulated, the inferior segment of the hair follicle can now grow downwards, forming a bulb around the dermal papilla. Now, the dermal papilla can signal matrix cells in the bulb to proliferate, differentiate, and grow upwards, forming a new hair.
- The catagen phase is also known as the transition or regression phase. It is the shortest of all three phases, and may only last a few weeks. During this phase, cell division in the matrix ceases, and the inferior segment of the hair follicle begins to regress. Eventually, the inferior segment of the follicle no longer exists, and the dermal papilla has moved upwards to contact the bulge once again. During this process, a club hair is formed with a white, hard node on the end.
- Finally, the telogen phase ensues, which is referred to as the resting phase. Club hairs, which are essentially dead, are held. On the scalp, these club hairs are typically held for about 100 days. Eventually, these hairs are released and shed so that the anagen phase can begin again with a new hair.
- At birth, all hairs begin in the anagen average; the human scalp contains over 100,000 hairs. At any one point in time, most hairs (85% to 95%) are commonly found in the anagen phase. These hairs can grow approximately 1 cm per month. Meanwhile, hair loss is continuous, with people losing about 100 hairs per day on average. With shampooing, the number of hairs lost can double.  
Around 9 weeks gestation, the fetal epidermis gives rise to small buds of specialized cells that will form the hair follicle and its associated appendages. Mesenchymal cells that have accumulated within the dermis help drive this process by secreting substances such as epimorphin that signal the epithelial cells to proliferate and migrate in a downwards (craniocaudal) direction towards the dermis. Once this process is complete, the fetus is left with a hair follicle containing a matrix derived from ectoderm and an underlying dermal papilla-derived from mesoderm. Additionally, an arrector pili muscle and a sebaceous gland form around each follicle. In utero, maternal androgens will stimulate the activation of fetal sebaceous glands, so that the glands can secrete a lipid-rich sebum that combines with desquamated stratum corneum cells to form the vernix caseosa.
Once the hair follicle has developed in the fetus, lanugo hairs grow in utero. These hairs are thin and short. They eventually shed by about 36 to 40 weeks gestation and are replaced by vellus hairs that cover most areas of the body. Meanwhile, thicker, courser terminal hairs can be found on the head in certain areas such as the scalp, eyebrows, and eyelashes. Beard hairs will arise once puberty is reached, with androgen hormones transforming the vellus hairs in this area into terminal hairs.
After birth, no new hair follicles will be made. However, new hair can grow from the existing follicles. Also, follicle size can still be altered after birth.  
Hair growth rate and hair density decrease with age. Hair loss, known as alopecia, is a common occurrence. It can be due to drugs, diet, hormone imbalances, altered mitotic activity, growth cycle abnormalities, among others. A thorough history, physical exam, hair pull test, daily hair counts, part width, clip tests to examine the hair shaft, hair growth windows, and hair pluck, and trichograms can all be used to diagnose hair disease. Scalp biopsies, hormone studies, and a potassium hydroxide examination for fungi may also need to be performed in certain cases. It is important to diagnose hair disease correctly, as the treatment for hair loss is dependent on the diagnosis.
Male pattern baldness, known as androgenetic alopecia, is a common condition in which hair loss occurs as men age. With increased dihydrotestosterone binding to the follicle of hair receptors, each successive anagen cycle shortens in length. In these individuals, follicles shrink and gradually produce shorter, thinner, more vellus-like hairs. Possible treatments may include slowing the conversion of testosterone to dihydrotestosterone in men with this condition.