What is Earnest Money
It is usually in the form of a check. It is Escrowed (check is cashed) as part of an Offer to buy Real Estate. The money shows intent and consideration for a purchase.
Where does it go
Where ever it is mutually decided upon, but generally to either the Buying or Listing Broker's Escrow Account or Title Company. The check is cashed and it sets in Escrow until closing or ir is mutually decided that it will be returned to the Buyer. At closing it is applied to you down payment.
It may be 1% or less of the transaction up to 2-3% of the purchase price in hot markets. It is enough to show you are serious about buying and would not just walk away from the purchase.
How can you get it back
Mutual agreement, problems with property, unable to get financing, breach of terms on the part of the Seller.
How may you forfeit your Earnest Money
Breach or failure to perform, such as not applying for a loan. Just deciding you do not want to buy it without reason that a prudent person would understand.
So all in all Earnest Money is saying, hey I want to buy and here is the money to prove it!
You have shown them the Money!