also be in your contract with your Real estate brokerage. It is definatly a contractual question, whereas the answer is found in the agreed upon fully executed contract between the parties.
If your agent used a New Hampshire Association of Realtor contract, (which are reserved for Realtors), that issue is clearly spelled out in the form. That form is intended to be a contract between the buyer and seller. If the deposit is not being returned to the buyer--usually for a cause identified in the Purchase and Sales Contract--then those funds will either become the property of the seller, or in some specific (but rare cases) the seller and his agent may split the deposit.
If you did not use a NH Association of Realtors form as the "purchase contract", the form or contract you did use will probably have a performance clause--meaning if the buyer does not perform or chooses not to perform, the seller has some relief (like keeping the deposit).
If the underlying question is, Why should the Realtor get anything? That eventuality and agreement is between the Seller and his agent--the agent has probably been buying advertising and representing the seller in the transaction and this payment is really just a special thank you from the seller to his agent.
If the underlying question is, Would a "buyers agent" share in any payment generated off a deposit being held by a seller" That would likely be considered a conflict of interest and most certainly he or she should not accept such a payment. Also, all payments of any kind must be given the the Broker (normally the owner of the agency) and then the Broker pays the agent. So this issue--which is clearly an ethical topic--would also have to be evaluated by the Broker before the agent would get any funds.
Hope this helps and answers your question.
Dane Hahn Cell 603-566-5460