Good Faith Deposit
When you make an offer on a house, you'll have to put down a good-faith deposit. This is to discourage you from bidding on a lot of different houses with the intention of buying only one. This good faith deposit is usually several thousand dollars. If the deal falls through, you will get this money back unless you somehow violate your contract. If the deal goes through, the deposit goes toward your down payment and your share of closing costs.
The contract almost always specifies contingencies. That means the contract is valid only if certain requirements are met. For example, if your financing doesn't come through you aren't required to purchase the home. Contingencies also cover home inspection, termite inspection, title search and several other processes whose outcome could nullify the deal.