"The Constitution provides Congress with the authority to manage the federal budget through its 'power of the purse.' This In Focus summarizes federal budget and borrowing outcomes and trends for federal spending and revenues. The federal government incurs a budget deficit when total spending exceeds revenues over the course of a fiscal year. A budget surplus occurs when revenues exceed outlays. Budget outcomes are dependent on general economic conditions. Net deficits tend to decline in periods of high economic growth due to both increased revenues (through arise in earnings and subsequent tax payments) and reduced outlays (through a decline in demand for unemployment benefits and other programs). Conversely, deficits tend to increase in periods with lower economic growth."
CRS In Focus, IF11037
Congressional Research Service: https://crsreports.congress.gov/