I don't think, fed lends money to anyone. Government issues bonds and Fed buys these bonds.
As fed buys paper bonds from government, fed pays them in freshly printed dollars. Now government has the required number of dollars and goes on spending spree. when the government needs more cash, they issue more bonds, which are bought by Fed.
The case of bail outs are different. These are considered exception and under special privileges (If the failed company can bring down nations GDP by ~2% or more or if unemployment increases by 100K), then they bail out such huge corporations, which otherwise would cease to exist and impact the whole nation.
The numbers are for reference only. not sure of their internal considerations.