The primary function of oligodendrocytes is to produce and maintain the myelin sheath. Myelination increases the speed of electrical impulses along the axon through a process called saltatory conduction. This allows for more efficient communication between neurons. Additionally, oligodendrocytes play a role in providing metabolic support to axons.