An appraisal contingency states that the home must appraise for the purchase price or higher. In the event it does not, the buyer would be able to terminate the transaction and get their deposit funds back.
It hot real estate markets, it is possible a buyer may decide to waive the appraisal or add an appraisal gap clause that says they will cover a certain amount of money if the property appraisal comes in low.
A lender will base its loan amount on the appraisal market value, so a buyer who neglects the appraisal contingency in a contract may have to pay the difference.