"Total federal debt can increase in two ways. First, debt increases when the government sells debt to the public to finance budget deficits and acquire the financial resources needed to meet its obligations. This increases 'debt held by the public'. Second, debt increases when the federal government issues debt to certain government accounts, such as the Social Security, Medicare, and Transportation trust funds, in exchange for their reported surpluses. This increases 'debt held by government accounts'. The sum of 'debt held by the public' and 'debt held by government accounts' is the total federal debt. Surpluses reduce debt held by the public, while deficits raise it. [...] Congress has always restricted federal debt. The Second Liberty Bond Act of 1917 included an aggregate limit on federal debt as well as limits on specific debt issues. Through the 1920s and 1930s, Congress altered the form of those restrictions to give the U.S. Treasury more flexibility in debt management and to allow modernization of federal financing. In 1939, a general limit was placed on federal debt."
CRS Report for Congress, RL31967