It is very similar to a mortgage. With a mortgage, you continue to hold full legal title to the property you have bought but you give the lender a lien on the property. If you do not make your mortgage payments, the lender can foreclose on the property.
In some states, a deed of trust is used instead of a mortgage. With a deed of trust, you give the lender a deed to the property but the lender can only use or sell the property if you do not meet the loan terms.
As a practical matter, there is very little difference between these two methods of giving the lender a security interest in the property.