The country sells bonds and people buy them.
The country can decide that it is better to have the money now in exchange for the obligation to pay off the bond on its maturity date. If the extra money they get from the sale of bonds is put to good use then the resulting economic expansion can partially offset the interest that they pay on the bonds.
Latest Answers