If PD wants an answer, he should ask GOOGLE, which would direct him to a number of sites that describe mortgages and deeds of trust.
See, e.g.,
http://www.nolo.com/legal-encyclopedia/ ... trust.html Mortgages and deeds of trust are just devices to create a valid lien on real property to secure repayment of borrowed funds. The borrowed money may be used to purchase the property or improve the property or -- assuming the property is raw land or business property or that the state law allows borrowing against a homestead -- to take a trip around the world or pay for a face lift.
I presume that most of the readers of this forum understand that some states -- by statute -- permit loans (notes) secured by real estate to be secured by a "contract" known as a mortgage, in which the lender holds the lien and the lender acts directly to foreclose on the lien, usually by judicial foreclosure. In such states, there is usually a judicial proceeding at which the lender proves up the debt and balance due and the existence of a valid mortgage duly recorded. Then a judicially ordered sale takes place and the property is sold to the highest bidder with the proceeds applied to the balance due on the note.
Other states (Texas, for example) use the "Deed of Trust" in which legal title is held by a trustee for the benefit of a lender -- usually an officer of the lender, in Texas -- who, upon default, will conduct an non-judicial foreclosure sale on notice only (no court is involved) and will sell the collateral real estate to the highest bidder and apply the proceeds in satisfaction or partial satisfaction of the debt. If the loan is paid off, the trustee conveys legal title to the borrower.
The advantage is non-judicial foreclosure. This is easy to understand. If I want to borrow money secured by real property, I sign a note and agree to and sign a deed of trust. The deed of trust gives legal title to the trustee and equitable title to me. I have the right to occupy and use the property until I default. If I default, the trustee gives me notice and conducts a sale for the benefit of the lender, who is the beneficiary under the deed of trust.
In both cases, prior and priority liens ( particularly real estate ad valorem taxes) are not extinguished but subordinate liens (second liens, federal tax liens, judgment liens) are wiped out. Also, the usual buyer is the lender, who credit bids up to the amount due on the note. Rarely is there a third party with cash who purchases at foreclosure, but I have seen that happen.