In both a national budget and household budget, a surplus is the result of

taking in less than what is needed to spend
paying down debts to very low levels
tracking expenses over several months
spending less than what is taken in