Back in the last century, before the banking fiasco that led to the first lending bailout, it was easy to figure out what a lender was. It was the local banker who lent money to a buyer to buy a home. It was generally lent for 20 years (or less.) The rate was fixed. Twenty years later when you paid it off, you knew who held the mortgage.
Not any more. There are Banks, Mortgage Brokers, Mortgage Bankers, Wholesale lenders. They sell the mortgage after the close of escrow to any number of investors, and those investors sell off those investments to even more investors.
A company, individual or institution that originates mortgages. Mortgage bankers use their own funds, or funds borrowed from a warehouse lender, to fund mortgages. Sometime they continue to collect the payments (service) their loans, other times they contract the service to another company.
Examples are Bank of America, Wells Fargo, Citibank and other large institutions, some with local banks others are strictly investment banks.
An intermediary who brings mortgage borrowers and mortgage lenders together, but does not use its own funds to originate mortgages. A mortgage broker gathers paperwork from a borrower, and passes that paperwork along to a mortgage lender for underwriting and approval. The mortgage funds are then lent in the name of the mortgage lender. A mortgage broker collects an origination fee from the lender as compensation for its services.