The national debt is the sum of all past years’ deficits. Each year that the government runs a deficit (meaning it spends more than it brings in with taxes), that amount is added to the debt. In the event of a surplus, the extra money is used to pay the debt down.
During tough economic times like the Great Recession, government spending automatically increases because there is an upsurge in the number of people eligible for need-based programs like food stamps and unemployment benefits. At the same time, tax revenues tend to decrease because fewer people are employed and therefore pay less in taxes. Corporations also earn less profit, and they too pay less in taxes. What’s more, lawmakers may intentionally increase government spending during a recession in order to stimulate the economy, even though they know that the result will be a deficit.