The process is not nearly as simple as everyone here thinks.
The federal reserve and the US government are two separate identities. There comes the problem for the US government and its huge national debt. The Fed is a profit motive private company owned indirectly by international bankers (top banks in several European (mainly England) countries and the US as well eg. Rotheschilds, Rockefeller's institutions among the US ones).
Whenever the US govt. wants to print money, whether to meet a budget deficit or social security payments, it cannot do so itself because only the Fed has the right to print notes in the US, which is a separate entity to the US government. It has to BORROW from Fed by selling 5-30 yr treasury bonds to the Fed, and thus, it has to pay around 2-3% interest on the amount borrowed, whenever it wishes to 'print' money. The Fed in turn, sells these treasury bonds to foreign countries if deemed necessary, which accounts for international central banks and organisations.
Over the long term, this process assumes that the production/investment vehicles, for which the govt. spends this money, covers the minimum 2-3% interest which the govt. has to pay to the Fed. Over the short term, this may be considered "money out of thin air". But over the long term (duration of the treasury bonds, typically 5-30 yrs), the government's expenditure on production and investment vehicles must return at least 2-3% for it to be able to pay the interest and to ensure that the Fed doesn't have to sell any gold to pay the international/local creditors, due to a default of the US government. The Fed will, in turn, pay any foreign central banks, who claims its bonds, after they have become mature.
Bonds are traded as well, which means that if a central bank/organisation does not want to hold a portion of the US debt anymore, it may sell the bond to a central bank/organisation of another country wishing to purchase such bonds. However, the bonds can only be claimed (with interest) after the maturity period, when the FED will be compelled to pay them + interest (not the US government).
Its a 2 way process. This is to ensure that the US government cannot simply print money to finance its expenditure (without the treasury bond mechanism) and raise inflation to 200000% and devalue the dollar to 1 Bangladeshi taka = 1 dollar (now its $1=70Tk). And to ensure the transparency of the US bonds, the ownership of the Fed rests in the hand of foreign central banks as well as some US banks.
The Fed earns its 'profit' through the difference between the interest rates charged to each party, which includes the US government as well (a very nominal difference though).