The next step into the Secondary Mortgage Market process in the aggregator. The aggregator buys the mortgages from banks and other originators. It then packages them up as mortgage-backed securities and sells it to securities dealers.
These mortgage-backed securities are investment opportunities that are bundled up mortgages. The aggregators send them off to a rating agency to be rated on their risk of money loss. They securitise the mortgages to either form a private label mortgage-backed security (think of Wall Street) or form agency mortgage-backed security (think of Fannie Mae and Freddie Mac). They then sell it to large institutional investors, insurance companies, hedge funds, and wealthy clients.
This is a complicated process because they have to make sure they receive a profit so before a security is sold a process called hedging a mortgage pipeline is involved. They make profit by the gap between the sales tag on the mortgages they obtain and the price the mortgage-backed securities sell for.