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.
When the rates rise, it’s no longer worth doing these marginal businesses and so growth slows down. You’re not going to borrow at 5% to make 3%.