In that scenario you lent me a total of $100,000 and I paid you back $100,000 but never was more than a $1000 outstanding.
What is the purpose of borrowing money overnight if the FED knows they have that money the next day?
Who profits off of these loans and how do they profit?
At the end of a business day, banks need a certain amount of reserves to support their loan books. If they're short, they can borrow Fed Funds overnight from another bank. During the crisis, all the banks were short, so they borrowed overnight from the Federal Reserve Discount Window.
Who profits off of these loans and how do they profit?
The lender (Federal Reserve) profits by charging interest on the loan.