Understanding the Emergence of Public Debt