In the standard Georgia Association of Realtors contract (see the last paragraph of my answer if you aren't working with a Broker), you typically give the earnest money to the Broker at the time you sign the offer, and then the Broker is obligated to deposit the money in their escrow account within 5 banking days of the Binding Agreement Date (when the offer is agreed to by all parties and becomes a Binding Agreement, commonly referred to as a "Contract"). In my opinion, their are two main purposes of the earnest money: first, it shows that you (the buyer) are serious about buying a property and you are willing to put some money at risk in the process; and second, it is typically the amount that you (the buyer) will lose if you don't go through with the contract as it is written (known as a default on the contract). So the money has to be deposited at the beginning of the transaction in order for it to show you are serious, and to be available to the seller if you default or don't close according to the terms of the contract.
When the transaction is completed at closing, that earnest money is credited back to you on the closing statement (in effect it becomes a part of your down payment that you have already paid prior to closing), so you don't have to pay it again. Techncally speaking, at most closings you will get a credit for the earnest money, and the Broker holding the earnest money will keep it as part of the commission they are due. The rest of the commission is given to them at closing (typically from the seller).
If the earnest money wasn't cashed before closing, a couple of problems could arise. First, if the transaction goes along fine and gets to a closing, the buyer would have to bring additional funds to close (since the earnest money was never cashed and made "good"). And second, if the transaction DOESN'T close because the buyer defaulted, the seller would have a very difficult task of pursuing the buyer legally to get compensated for the buyer's non-performance.
One other thing: if there is no Broker involved in the transaction, I would be very hesitant to give the earnest money directly to the seller - I would recommend getting the law firm you are going to use to close the transaction to hold the money in THEIR escrow account, so it is held by a third party. Sorry for the long-winded answer, but it's a very good basic question that brings up a lot of issues. Good luck with your transaction, and if you need a local Realtor, please think of me.
Mitch Falkin, Associate Broker
RE/MAX Greater Atlanta