The primary function of a fuse in an electrical circuit is to protect the circuit from excessive current flow. When the current exceeds the fuse's rated capacity, the fuse element (usually a metal wire) melts, breaking the circuit and preventing damage to electrical components, overheating, or potential fire hazards. This process ensures safety by interrupting the flow of electricity when abnormal conditions occur, such as a short circuit or overload.