Earnest money is a deposit — typically a small percentage of the purchase price — that a buyer puts down shortly after an offer is accepted, as a signal of serious intent to the seller. It's held in escrow, usually by a title company or brokerage, not paid directly to the seller, and it's applied toward your down payment or closing costs at closing if the sale goes through.
What happens to earnest money if the deal falls apart depends entirely on the terms of your contract and the reason the deal ended. If you back out for a reason your contract protects — commonly, findings during a valid inspection or option period, or the property failing to appraise, depending on your contingencies — the earnest money is typically returned to you. If you back out outside of those protections, you can risk losing it, which is exactly why understanding your contract's specific terms matters so much before you sign.
In many contracts, especially common in Texas real estate, there's also a separate, smaller "option fee" paid directly to the seller for the right to terminate the contract for any reason during a defined option period — typically a short window of several days right after the contract is signed. This is different from earnest money, and the two work together: the option period is your protected window to inspect the home and change your mind for essentially any reason, and earnest money is what's at stake if you back out after that window closes without a valid contractual reason.
These mechanics vary by state and by the specific contract form used, so the details in your actual contract — not general averages — are what govern your situation. This is a good moment to ask your agent to walk you through your specific contract's earnest money and option/contingency terms line by line before you sign.
The overall purpose of both earnest money and an option period is the same: they balance a seller's need for a serious, committed buyer against a buyer's need for time and information before fully committing. Understanding how they work turns what can feel like scary fine print into a predictable, manageable part of the process.