Stud tail (also known as Supracaudal Gland Hyperplasia or Tail Gland Hyperplasia) is caused by hypersecretion of the glands in the supracaudal organ (an organ on the base of the tail).
Sebaceous glands secrete oils (known as sebum) which lubricate the skin, preventing dryness and irritation. The sebaceous glands are mostly found in dorsal, eyelids, chin, surface of the base of the tail, lips, scrotum, and prepuce. They are connected to the hair follicles.
The glands also play a role in territorial marking and any observant cat owner will have seen their cat rubbing his face and chin along objects. Over time this rubbing will leave greasy patches.
Male hormones are increased secretions, which is why stud tail is more common among entire male cats (known as studs), although it can affect females and desexed (neutered) males also.
What are the symptoms of stud tail?
Symptoms of stud tail include:
Hair at the base of the tail becomes matted and greasy
Hair at the base of the tail may thin or fall out
Hair at the base of the tail may develop a rancid odour
Yellow to black, waxy debris on the skin and hairs of the tail base. 
Secondary bacterial folliculitis (inflammation of the hair follicles) may be present
How is stud tail diagnosed?
Your veterinarian will perform a physical examination of your cat. Diagnosis is based on physical examination.
How is stud tail treated?
Treatment of stud tail involves washing twice a day with an antiseborrheic shampoo. Your veterinarian may clip the hair to permit better penetration of the shampoo.
Neutering may relieve the cat of stud tail.
Antibiotics to treat any secondary infections.
 The Cornell Book of Cats (p. 169)