The purpose of earnest money is to provide the seller with compensation in the event that the buyer backs out of the deal through no fault of the seller and in violation of the agreements in the purchase contract. If that happens, the seller gets to keep the earnest money.