The primary function of a coupling is to connect two shafts, allowing for power transmission while accommodating misalignments or movement.