You're confused: the annual "deficit" and the total "national debt" are two different things. The deficit is the difference between income and spending in a fixed time period. The national debt is the cumulative amount owed.
A balanced budget (i.e., zero deficit) or even a large but insufficient surplus doesn't stop the national debt growing. It's like a credit card. Even if every month you pay off what you spent the previous month (balanced budget), the interest keeps compounding on the principal you owe and your total debt keeps growing. Unless the government makes a serious effort at paying off the interest and paying down the principal, the national debt will keep growing. (Of course, the principal plus interest becomes the new principal on each compounding cycle, so the principal is a moving target.)