Maybe this will help:
The purchase contract will gpverm what happens. If it is not in writing, then it won't happen
Are you a principle in this transaction, or is this hypothetical?
Based on your profile I am going assuming that you are a first time buyer (if that is wrong, then please repost)
When you make an offer on a property, the seller wants to see that you are serious. Part of that demonstration is showing the seller that you are able to pay for the property, usually a letter from a lender stating you are qualifed.
Also, it is customary for a deposit to be made. Different areas of the country have different customs and terms. This initial deposit in California, where I work, is normally three percent of the purchase price. The buyer can offer more, however three percent is sort of the minimum.
This deposit means a couple of things. While your offer is being considered your Realtor (representing you, the buyers) holds onto your check. Once the offer is accepted, escrow is opened and the check is deposited with a neutral third party. In some states it an escrow company, in others it is a title company that performs the escrow duties. The purpose of esrow is to make sure that both parties carry out their duties agreed to in the contract, and at the end of the transaction, one party receives the deed and the keys, the other party the proceeds from the sale.
During the escrow period there are duties that are required of both parties. The buyer does inspections (physical, wood destroying pest, etc.) and the seller is required to provide information (Natural Hazard Disclosure, Lead Based Paint, Title report, etc.). The deadlines stated in the contract control what happens by when.
Usually, if the buyer backs out of the contract after say the physical inspection, or the property does not appraise for the dollar amount of the sale, or the buyer ends up not qualifying for financing, the seller will refund their inital deposit.
However, AFTER the final contingency item has been removed, the buyer is pretty much on the hook. (Of course, you can always hiire an attorney.:)
(again , this is not legal advie). Every time the seller provides the buyer with a new disclosure (say, the wood destroying pest inspection report), that report gives the buyer THREE days to consider the report and\, if they want, cancel.
This is one of the reasons that Realtors represent buyers and sellers. The two Realtors do not have an emotional link to the transaction. Their job is to look out for the best interests of the buyer and seller, and come up with a fair bargain. This means if the wood destroying pest report require repairs, asuuming everything else is in agreement, the Realtors will help the buyer and seller negotiate a fair deal on who fixes what and pays how much.
Again, I do not know your local laws. However, in general, most of the time the contracts are formulated to protect the interest of both buyers and sellers. Once a property is "in escrow", that means that it is no longer "for sale". Because the seller has removed his property from the market, he can no longer solicit new offers. In some cases it is possible for the seller to prove damages and the buyer may not receive all of their initial deposit. For example, if they had agreed for the appraisal to be completed within ten days after signing, and the appraisal is not completed, the seller could opt to cancel the contract, and perhaps say"My property has been off the market for ten days, I want you to pay me $500 to compensate me".
A second payment is made which is the "down payment" to enable the buyer to qualify for a loan. This money is normally deposited after the appraisal and loan approval have been granted. The date the money is due is stated in the contract. Sometimes it's possible for the buyer to qualify for the loan, the appraisal to be approved, but for some reason the buyer does not have or will not provide the deposit. In this case, the "liquidated damages" might exceed the amount of the inital deposit (it depends what the contract says). Most lenders are requiring 10-20% down, with the current loan programs.
That would mean that after ALL the inspections are completed, and while the "behind the scenes" work is being completed, the final deposit is made. In California there is a final inspection three days prior to the turnover of the property. This inspection is to verfiy that the property is in substantially the same condition as when escrow opened. One of our agents did a final walkthrough and a hot water heater burst, the entire house was flooded, and the wood floors had warped. The family had moved out. (a great reason to purchase home warranty protection for sellers). The seller had to replace the floors. The buyer could have backed out because of the changed condition of the property...and probably could have received their deposit(s) back.
Hope this helps.