There is a long list of the types of lenders that make loans using a mortgage for security. They include government agencies, lending institutions (such as banks and mortgage bankers), credit unions, finance companies, mortgage brokers that arrange loans, insurance companies, and even individuals.
There are two types of lenders. The first type of lender is the primary lender, which is the type you will deal with. This may be a local bank or other financial institution that meets with you and originates your loan. After your transaction is completed, your primary lender can either keep the loan or sell it on the secondary market. If your lender keeps the loan, it is called a portfolio loan.
The second type of lender is one that buys loans made by primary or retail lenders, and does not deal directly with the public. Entities that buy existing loans in the secondary mortgage market may be pension funds, for example, or even primary lenders that have money but cannot originate enough loans. The largest buyers are government agencies or quasigovernment agencies, private companies originally created by Congress.