Many of my clients do not understand "earnest money" and it's role in a real estate transaction when making an offer. Basically, it's a deposit towards the purchase price and closing costs that will "hold" the home for you prior to closing. The ernest money is held in a separate escrow account and released as determined by the transaction.
Basically, it is confidence money for the seller that you are serious about purchasing the property and are taking the proper steps to do so. The seller can be confident to take the property off the market with an accepted contract because a buyer's default will result in the seller keeping the earnest money.
To understand how to protect your earnest money as a buyer and understand your obligations in a real estate transaction always consult a qualified real estate attorney. Here is a little example that shows this is not always well understood.
That said, each transaction is different and earnest money deposits will differ as well. New construction homes in which you customize with personal selections may require 5% to 10% of the purchase price. If the buyer defaults, the developer may have to change the selections to accomodate another buyer... very costly.
I try to protect buyers with the lowest, but fair, earnest money amount possible. I once negotiated a deal with only $2000.00 total earnest money on a Rogers Park condo. With all the surrounding competition, the developer never even asked us to raise the earnest money...even though the home wasn't closing for months and my clients customized the units.