Foreclosures are the remedy available to a lender when a borrower who has pledged land as security fails to repay the loan.  

The owner of a piece of property who borrows money through the use of a mortgage is said to have an "equitable right to redeem", meaning that even though he owes money to a lender who has a charge against the property and has breached the mortgage loan contract and therefore lost the legal or contractual right to redeem the property the owner still has the ability to redeem the property and repay the loan if he can somehow raise the money.

What this means to a lender who's loan has been defaulted on is that before he can take the property or otherwise cause it to be sold he must extinguish the borrower's equitable right to redeem the loan. This is generally a technicality in that a borrower who has the funds to redeem the loan through his equitable right of redemption probably wouldn't find himself in the foreclosure situation in the first place.

In BC the process of foreclosure starts with a petition to the Supreme Court.  It is prepared, filed, and served to all respondents. The respondents are the borrower, of course, but also anyone else who has a claim on title that has to be extinguished.  These can include any guarantors, subsequent mortgage lenders, the registered owner of the property (if different from the borrower), a purchaser (if there is an agreement to sell the property in existence) and any Builders' Lien claimants. The petitioner is the lender who wants to foreclose (or for that matter, a strata corporation that is owed funds).

There are various remedies available to a lender.  The first step is an agreed upon accounting of all monies owed.  The Registrar of the Supreme Court will review the mortgage contract and the payment history and determine exactly what is owing, including how the debt will change as a result of accruing interest as time goes by. This produces a figure that both sides have to accept and agree to should payment actually occur.

Next is a judgement on any personal covenants that the borrower may have given the lender.  The personal covenant survives the sale of the property, so even if the borrower has disposed of the property he's still liable for the outstanding loan amount.  This sort of judgement can also be applied to any guarantors or subsequent purchasers (assuming they also provided a covenant to the lender when purchasing).

If these steps work the process stops.  For example, if the guarantor pays the bank, or the new buyer clears up the debt, the lender has been satisfied and the foreclosure process will usually stop.  If the process does stop at this stage it's pretty obvious that it wasn't a very serious problem to begin with.

For some properties a receiver can be appointed.  Commercial operations or rented properties fall into this category.  Mortgage contracts often have an assignment of rents, and this clause can be invoked. 

A lis pendens can also be filed against a property.  This stops the property from being sold while the lender and borrower sort out their differences.  

For a serious default foreclosure of the borrower's interest in the property (and, as mentioned, the rights of all other respondents)is the normal course of affairs.  

The first thing that occurs is for the lender to send a demand letter to the borrower specifying a time frame to repay the outstanding loan.  Failure to do so results in the lender proceeding to the next step, which is the filing of the petition in the Supreme Court. 

The Court will then issue an Order Nisi which formally establishes the amount required to redeem the mortgage and the time frame within which to do so.  This amount of time is called the redemption period.  Its often six months, but the time may vary.

At this point there are two ways to go. The first involves the petitioner asking the Court to approve a judicial sale.  In this case the title of the property doesn't change, but the property is listed for sale.  Generally  a realtor will list the property, get offers and present them to the Court.
The Court (in the form of a Master) will review the offers and if they are acceptable (acceptable to the lender and fair to the borrower) will make a court order specifying that the property be sold with a clear title, and with the proceeds satisfying the debt.  Any excess will go to the borrower; in the case of a shortfall the lender has further redress against the borrower.

The second way is that of the absolute order of foreclosure.  If the redemption period has expired, the value of the property is the same as the mortgage debt, or more, the borrower is "judgement proof" and the property can't be sold (i.e, there is no interest from any buyers), the lender can petition the Court to transfer title free and clear of all encumbrances to the lender. 

An Order Absolute cuts both ways.  If it is granted the lender cannot enforce a personal covenant against the borrower unless the order is re-opened.  If the lender sells the property to a third party he cannot enforce a judgement against the borrower because the property cannot be restored upon repayment. If the borrower comes up with the funds to re-pay the loan the order can be re-opened, and the borrower's right of equitable redemption is revived, but this can only be done by the Court, is only done on equitable grounds, and is rare. 

Anyone with a passing acquaintance with foreclosures in British Columbia will know that the judicial sale route is the most common one used in foreclosures in BC.  Often referred to as a "court ordered" sale, the court, through its agents (the lawyers) supervises the sale.  

After the Order Nisi has been granted, and usually after the redemption period is over, the lawyer for the lender will petition for a conduct of sale order.  He will then cause the property to be listed with a realtor who will market the property.  The property must be competitively priced to protect the owner's "equity of redemption", and the Court will attempt to ensure this.  

Because a successful sale will be in the form of a court order all offers to purchase must be subject free before they go to court.  The Master's decision will be final, and any successful purchaser who does not complete will be defying a court order.  The lawyers won't let this happen.  All mortgage, inspection and any other subjects must be removed before a court date is arranged.

One subject free offer that is acceptable to the lender is enough to trigger a court date.  At court the lender's lawyer will present the offer and describe the marketing activities and market response to the offering of the property.  If the Master is satisfied that the marketing has been reasonable, and that the offer is representative and fair, he will accept it (he is the decision maker, not the lender or borrower) and issue a court order.

If there is a court date there can be multiple offers.  The price of the first offer will be known, as it is a court document and therefore public knowledge.  This allows competitors to know exactly what they have to do to beat the first offer.  Additionally, the lawyers for some lenders will specifically require that the listing realtor disclose the first offer price to subsequent purchasers.  
If you find yourself in this situation remember that offers can be changed right up to the time they are presented to the Master.  Success often depends on sizing up the competition, making an educated guess at what they are offering, and then adding as little as $200 to the highest offer. 
If you have never attended a foreclosure before the action will go by quickly.  Buyers often do not even know they've been successful until someone more experienced in watching the court tells them.

Remember, these are rules for BC. Mortgage laws vary from jurisdiction to jurisdiction and country to country.