Relevance of government liabilities to GDP
The government debt represents the total liabilities outstanding that the government must (at some point) repay to investors. Generally to do so, governments tax their populace, either now, or at some future point.

The often cited Debt to GDP ratio figure is one shorthand for understanding how difficult it will be for any given government to raise the revenue necessary to cover its debts, and/or decrease government spending. If country "A" had \$100 billion in outstanding debt, and country "B" had \$400 billion in public debt, which would be in worse shape (that is, which would likely have a harder time raising the necessary funds)? Ultimately, it depends on a variety of factors, one of which being "how much can the country realistically raise in revenue?" If country "B"'s GDP is ten times the size of country "A," then even with a higher debt load, it represents a smaller relative amount owed, and might then be easier to pay back.

Of course, this is just one common, convenient shorthand statistic often used to quickly assess how sustainable a country's debt is. There are many other factors which must be considered if you're trying to comprehensively measure "default risk." But Debt/GDP is a pretty easy, useful one that has become popular over time.