Regulations relating to foreclosure differ by state, so check your states statutes.  
 
Notification of intent to foreclose.  Many states require that a lender notify the borrower in advance(30 days, for example)before obtaining a court judgment to foreclose.
 
Nonjudicial foreclosure.  Many states permit lenders to add a clause to a mortgage document that permits the lender to foreclose and sell the property without obtaining court approval.
 
Right of redemption.  Some states(New Jersey, for example)permit a defaulting borrower to satisfy the loan default and recover the property if done within a specified amount of time after the property is sold. 
 
Deficiency judgement.  Some states permit a lender that forecloses on a mortgage to file a judgement against the borrower entitling the lender to collect form the defaulted borrower any amount of the outstanding mortgage not covered by the sale price.