The primary function of a circuit breaker in a home electrical system is to protect against overloads and short circuits by interrupting the electrical circuit when necessary.