A budget surplus occurs when the government's total revenues exceed its total expenditures for a given fiscal period. This results in the government having more funds than it needs to cover its spending obligations, leading to a positive balance in the government's accounts.