Secondary Mortgage Market
One lender (originator) sells or assigns the note and mortgage to another lender, typically termed an investor.  Transfer of the loan is made either by promissory note or a separate document of assignment.  Assignment of the note is not really necessary though since a mortgage without a note is worthless (there would never be a default for the mortgagee to foreclose on) and a note without a mortgage would be far less secure.