There are mortgage broker companies, mortgage bankers and then there are direct lenders. There are distinct differences between these three most common forms of mortgage companies. They are all involved with providing mortgage loans, but a primary difference is where the actual mortgage funds come from.
A mortgage broker does not have their own money to lend out. They take the application from the consumer who wants the mortgage, then they "shop" this deal around among various mortgage bankers or direct lenders. If the application fits the guidelines set forth by the banker or lender, then an offer is made to the broker to provide a mortgage to their applicant.
Even though the mortgage broker company may be called XYZ, and is who the consumer is dealing with, the actual money is coming from a banker or lender, which is where the consumer will send their monthly payments. The broker has simply gotten in between the borrower and the lender and makes their money in the form of commissions involving points and origination costs.
A mortgage banker however, also advertised as a mortgage company, will also take an application from a consumer, but rather than shop around for a lender who will accept it, they will provide the money themselves, which they may obtain from a credit line they have in place.
This credit line, which could be in the millions of dollars, may be provided from a direct lender who allows the banker to have access to draw money at will to provide a mortgage loan, if the borrower fits the guidelines set forth by that lender. The loan is then typically closed under the mortgage banker's name. The banker then, usually before a first payment is even due, will transfer that mortgage loan over to the lender who provided the credit line. This system allows the banker to act quicker than a broker, and in some cases, even have what is called "delegated underwriting" where they can make their own underwriting decisions based on the lender's guidelines, thus saving time from sending the deal to the lender for review.
The idea here is that once the loan is closed, the lender who provided the credit will take over the servicing of the loan and the consumer will make payments directly to the lender, and the banker is out of it, of course with a profit made for points charged to the consumer. The lender may also provide bonus points to the banker, for volume for instance. In some cases a credit line may even be provided to the banker from an outside source, other than a direct lender, and in this case, the banker may sell the loan to any party who will buy it. If they cannot find a buyer however, they are stuck with that loan and must collect the monthly payments from the consumer themselves and pay any interest due on the credit line until the loan amount has been paid back into the credit line.
Finally, there is the direct lender who has its own money and creates its own guidelines for mortgage loans. These are normally large institutions with billions in assets. They may work in different aspects regarding mortgage loans, which could include working within the wholesale arena, providing mortgage loans to consumers through a broker or a banker, providing credit lines and delegated underwriting or they may also deal direct with the borrower on the retail side and eliminate brokers and bankers all together.
In any instance, when a consumer takes on a mortgage loan, regardless of who may end up owning it, the terms of the loan cannot change. It is not unusual for a loan to be sold and transferred many times during it's lifetime.