Why do banks lend money? I thought they create it via writing into their database "Tomesco: $100" and boom $100 was created?
The fed does this for banks that can't find another bank to transact with, albeit at a slightly higher rate. The fed will also borrow money from banks at a slightly lower rate. This causes the banks to naturally lend among each other between those two rates. This is how the fed controls the interest rate.
The other thing the fed does is buy treasuries. I think this is where the "printing" of money happens. The fed buys a treasury on the market and pays for it by printing money and placing it in the appropriate account. This is how the fed controls money supply.