These days, a common refrain heard from real estate agents is that you don't know a listing is sold until title transfers from the seller to the buyer. Before the housing downturn, there was a point during the transaction that buyers and sellers had some certainty that the closing would occur. Now, more deals fall apart, so there is less certainty in general.
Before a listing has a chance of selling, the buyers and sellers must agree on the terms of the purchase agreement. This can include such things as the contract contingencies and how long they will run, the closing date, when possession will be delivered to the buyers, and who pays which sale fees, such as transfer taxes and title insurance premiums. This is in addition to agreeing on the purchase price.<