A mortgage, is sold to the SPV at the discretion of the bank to securitize it into a mortgage backed security, that is, the mortgage is said to have passed to the SPV which is usually a third party. The mortgage bank continues to service the mortgage on behalf of the SPV so that the client contact need not be passed on. In return for his service, he receives a fee from the SPV. The SPV issues MBS which are usually structured in various tranches to investors. These tranches may be AAA rated senior debt that is 95% of pool value, a junior debt which is again divided into one or more tranches rated AA, A and so on which is 5% of pool value and a reserve account usually guaranteed by the originator (mortgage bank) and this is less than 1% of pool value. The MBS is divided into different tranches to increase the credit risk of senior debt so that lower yield can be paid on the MBS.
An investor of an MBS gets the right not only to the cash flows but also to the collateral associated to the cash flows. However, the sale of collateral is only a supplementary measure. Once the servicer or originator receives cash flows (interest and a mortization as per the contract) from the mortgagor, he transfers these cash flows to the trustee who then pays the investors coupon rate and principal.